Revision cceb233...

Go back to digest for 9th September 2012

Optimization in KDE Base

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

Split SceneOpenGL into a concrete SceneOpenGL1 and SceneOpenGL2

SceneOpenGL turns into an abstract class with two concrete subclasses:
* SceneOpenGL1
* SceneOpenGL2

It provides a factory method which first creates either the GLX or EGL
backend which is passed to a static supported() method in the concrete
sub classes. These method can test whether the backend is sufficient to
be used for the OpenGL version in question. E.g. the OpenGL 2 scene
checks whether the context is direct.

The actual rendering is moved into the subclasses with specific OpenGL 1
and OpenGL 2 code. This should make the code more readable and requires
less checks whether a Shader is bound. This is now known through the
Scene: the OpenGL1 scene will never have a shader bound, the OpenGL2 scene
will always have a shader bound.

To make this more reliable the ShaderManager is extended by a disable
method used by SceneOpenGL1 to ensure that the ShaderManager will never
be used. This also obsoletes the need to read the KWin configuration
whether legacy GL is enabled. The check is moved into the supported
method of the OpenGL2 scene.

REVIEW: 106357

File Changes

Modified 7 files
  •   kwin/composite.cpp
  •   kwin/options.cpp
  •   kwin/options.h
  •   kwin/scene_opengl.cpp
  •   kwin/scene_opengl.h
  •   kwin/libkwineffects/kwinglutils.cpp
  •   kwin/libkwineffects/kwinglutils.h
7 files changed in total