From 18814c66a3511b65ba943be2afe51f3c987a02d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Sun, 12 Dec 2010 14:14:22 +0100 Subject: [PATCH] Coverswitch works on GLES. No multi-screen, no reflections yet --- effects/CMakeLists.txt | 2 +- effects/coverswitch/coverswitch.cpp | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/effects/CMakeLists.txt b/effects/CMakeLists.txt index cb9807cbec..39f66a6ca1 100644 --- a/effects/CMakeLists.txt +++ b/effects/CMakeLists.txt @@ -89,6 +89,7 @@ endif( NOT KWIN_HAVE_OPENGLES_COMPOSITING ) # OpenGL-specific effects if( KWIN_HAVE_OPENGL_COMPOSITING ) + include( coverswitch/CMakeLists.txt ) include( flipswitch/CMakeLists.txt ) include( glide/CMakeLists.txt ) include( sheet/CMakeLists.txt ) @@ -98,7 +99,6 @@ if( KWIN_HAVE_OPENGL_COMPOSITING ) endif( KWIN_HAVE_OPENGL_COMPOSITING ) if( KWIN_HAVE_OPENGL_COMPOSITING AND NOT KWIN_HAVE_OPENGLES_COMPOSITING ) include( blur/CMakeLists.txt ) - include( coverswitch/CMakeLists.txt ) include( cube/CMakeLists.txt ) include( explosion/CMakeLists.txt ) include( invert/CMakeLists.txt ) diff --git a/effects/coverswitch/coverswitch.cpp b/effects/coverswitch/coverswitch.cpp index 1dee9816cd..75866f9b52 100644 --- a/effects/coverswitch/coverswitch.cpp +++ b/effects/coverswitch/coverswitch.cpp @@ -32,7 +32,7 @@ along with this program. If not, see . #include -#include +#include #include "../boxswitch/boxswitch_proxy.h" namespace KWin @@ -129,6 +129,7 @@ void CoverSwitchEffect::paintScreen( int mask, QRegion region, ScreenPaintData& { if( effects->numScreens() > 1 ) { +#ifndef KWIN_HAVE_OPENGLES // unfortunatelly we have to change the projection matrix in dual screen mode QRect fullRect = effects->clientArea( FullArea, activeScreen, effects->currentDesktop() ); glMatrixMode( GL_PROJECTION ); @@ -180,6 +181,7 @@ void CoverSwitchEffect::paintScreen( int mask, QRegion region, ScreenPaintData& glMatrixMode( GL_MODELVIEW ); glPushMatrix(); glTranslatef( xTranslate, yTranslate, 0.0 ); +#endif } QList< EffectWindow* > tempList = currentWindowList; @@ -246,6 +248,7 @@ void CoverSwitchEffect::paintScreen( int mask, QRegion region, ScreenPaintData& if( reflection ) { +#ifndef KWIN_HAVE_OPENGLES // restrict painting the reflections to the current screen QRegion clip = QRegion( area ); PaintClipper::push( clip ); @@ -309,16 +312,19 @@ void CoverSwitchEffect::paintScreen( int mask, QRegion region, ScreenPaintData& glPopMatrix(); glDisable( GL_BLEND ); +#endif } paintScene( frontWindow, leftWindows, rightWindows ); if( effects->numScreens() > 1 ) { +#ifndef KWIN_HAVE_OPENGLES glPopMatrix(); // revert change of projection matrix glMatrixMode( GL_PROJECTION ); glPopMatrix(); glMatrixMode( GL_MODELVIEW ); +#endif } // Render the caption frame @@ -764,6 +770,7 @@ void CoverSwitchEffect::paintWindowCover( EffectWindow* w, bool reflectedWindow, if( reflectedWindow ) { +#ifndef KWIN_HAVE_OPENGLES glPushMatrix(); glScalef( 1.0, -1.0, 1.0 ); data.yTranslate = - area.height() - windowRect.y() - windowRect.height(); @@ -771,6 +778,7 @@ void CoverSwitchEffect::paintWindowCover( EffectWindow* w, bool reflectedWindow, PAINT_WINDOW_TRANSFORMED, infiniteRegion(), data ); glPopMatrix(); +#endif } else {