Coverswitch works on GLES.
No multi-screen, no reflections yet
This commit is contained in:
parent
5dfa8becb5
commit
18814c66a3
2 changed files with 10 additions and 2 deletions
|
@ -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 )
|
||||
|
|
|
@ -32,7 +32,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
|
||||
#include <kdebug.h>
|
||||
|
||||
#include <GL/gl.h>
|
||||
#include <kwinglutils.h>
|
||||
#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
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue