Revision 3f2d3e0...

Go back to digest for 23rd September 2012

Features in KDE Base

Martin Gräßlin committed changes in [kde-workspace] /:

Introduce a helper class to automatically push/pop Shaders

The ShaderBinder class can be used for the case that a block of code
should be executed with a given Shader being bound. This is useful for
all the cases where there is a if-block for OpenGL2 execution with a
Shader being pushed in the first line to the ShaderManager and popped in
the last line of the block. With the helper this can be simplified to:

ShaderBinder binder(myCustomShader);

or

ShaderBinder binder(ShaderManager::GenericShader);

The ctor of ShaderBinder pushes the given Shader to the stack and once
the helper goes out of scope it will be popped again from the stack.

In addition the helper can take care of OpenGL 1 compositing, that is it
just does nothing. So it can also be used where there is a shared OpenGL1
and OpenGL2 code path where the Shader should only be pushed in OpenGL2.
This basically removes all the checks for the compositing type before
pushing/popping a Shader to the stack.

REVIEW: 106521

File Changes

Modified 16 files
  •   kwin/lanczosfilter.cpp
  •   kwin/scene_opengl.cpp
  •   kwin/libkwineffects/kwinglutils.h
  •   kwin/effects/cube/cube.cpp
  •   kwin/effects/explosion/explosion.cpp
  •   kwin/effects/flipswitch/flipswitch.cpp
  •   kwin/effects/invert/invert.cpp
  •   kwin/effects/logout/logout.cpp
  •   kwin/effects/lookingglass/lookingglass.cpp
  •   kwin/effects/magnifier/magnifier.cpp
  •   kwin/effects/mousemark/mousemark.cpp
  •   kwin/effects/resize/resize.cpp
  •   kwin/effects/showfps/showfps.cpp
  •   kwin/effects/showpaint/showpaint.cpp
  •   kwin/effects/snaphelper/snaphelper.cpp
  •   kwin/effects/trackmouse/trackmouse.cpp
16 files changed in total