diff --git a/scene.h b/scene.h index 6b2eafcfac..11cb8db93f 100644 --- a/scene.h +++ b/scene.h @@ -23,12 +23,21 @@ class Scene public: Scene( Workspace* ws ); virtual ~Scene(); + // repaints the given screen areas, windows provides the stacking order virtual void paint( QRegion damage, ToplevelList windows ) = 0; + // shape/size of a window changed virtual void windowGeometryShapeChanged( Toplevel* ); + // opacity of a window changed virtual void windowOpacityChanged( Toplevel* ); + // a new window has been created virtual void windowAdded( Toplevel* ); + // a window has been destroyed virtual void windowDeleted( Toplevel* ); + // transforms the window areas to screen areas virtual void transformWindowDamage( Toplevel*, QRegion& ) const; + // updates cached window information after an effect changes + // transformation + // TODO - remove? virtual void updateTransformation( Toplevel* ); protected: Workspace* wspace; diff --git a/scene_opengl.cpp b/scene_opengl.cpp index d75e31f1fd..aeca18091c 100644 --- a/scene_opengl.cpp +++ b/scene_opengl.cpp @@ -184,6 +184,26 @@ void SceneOpenGL::windowGeometryShapeChanged( Toplevel* c ) w.discardTexture(); } +void SceneOpenGL::windowOpacityChanged( Toplevel* ) + { +#if 0 // not really needed, windows are painted on every repaint + // and opacity is used when applying texture, not when + // creating it + if( !windows.contains( c )) // this is ok, texture is created + return; // on demand + Window& w = windows[ c ]; + w.discardPixmap(); + w.discardTexture(); +#endif + } + +void SceneOpenGL::updateTransformation( Toplevel* c ) + { + // TODO this is only used in effects to later update + // screen damage - since opengl doesn't use screen + // damage, just leave this empty + } + SceneOpenGL::Window::Window( Toplevel* c ) : toplevel( c ) , glxpixmap( None ) diff --git a/scene_opengl.h b/scene_opengl.h index 3431f32f0a..f8e91240c7 100644 --- a/scene_opengl.h +++ b/scene_opengl.h @@ -27,9 +27,13 @@ class SceneOpenGL SceneOpenGL( Workspace* ws ); virtual ~SceneOpenGL(); virtual void paint( QRegion damage, ToplevelList windows ); - virtual void windowAdded( Toplevel* c ); - virtual void windowDeleted( Toplevel* c ); - virtual void windowGeometryShapeChanged( Toplevel* c ); + virtual void windowGeometryShapeChanged( Toplevel* ); + virtual void windowOpacityChanged( Toplevel* ); + virtual void windowAdded( Toplevel* ); + virtual void windowDeleted( Toplevel* ); +// screen damage is not used with opengl, it's completely repainted +// virtual void transformWindowDamage( Toplevel*, QRegion& ) const; + virtual void updateTransformation( Toplevel* ); private: typedef GLuint Texture; GC gcroot;