From 8f19fcd767eed836d23451da8bdb6efb1cb7d870 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Mon, 27 Apr 2009 18:34:05 +0000 Subject: [PATCH] Put OpenGL commands in magnifier in #ifdef KWIN_HAVE_OPENGL_COMPOSITING and effects->compositingType() == KWin::OpenGLCompositing. svn path=/trunk/KDE/kdebase/workspace/; revision=960004 --- effects/magnifier/magnifier.cpp | 54 ++++++++++++++++++--------------- 1 file changed, 29 insertions(+), 25 deletions(-) diff --git a/effects/magnifier/magnifier.cpp b/effects/magnifier/magnifier.cpp index 8bd574643d..7058547bce 100644 --- a/effects/magnifier/magnifier.cpp +++ b/effects/magnifier/magnifier.cpp @@ -96,33 +96,37 @@ void MagnifierEffect::paintScreen( int mask, QRegion region, ScreenPaintData& da data2.yTranslate = - int( cursor.y() * ( zoom - 1 )); effects->paintScreen( mask, region, data2 ); PaintClipper::pop( area ); -// ## TODO this should be inside KWIN_HAVE_OPENGL_COMPOSITING - glPushAttrib( GL_CURRENT_BIT ); - glColor4f( 0, 0, 0, 1 ); // black - for( PaintClipper::Iterator iterator; - !iterator.isDone(); - iterator.next()) +#ifdef KWIN_HAVE_OPENGL_COMPOSITING + if( effects->compositingType() == KWin::OpenGLCompositing ) { - glBegin( GL_QUADS ); - glVertex2i( area.left() - FRAME_WIDTH, area.top() - FRAME_WIDTH ); // top frame - glVertex2i( area.right() + FRAME_WIDTH, area.top() - FRAME_WIDTH ); - glVertex2i( area.right() + FRAME_WIDTH, area.top() - 1 ); - glVertex2i( area.left() - FRAME_WIDTH, area.top() - 1 ); - glVertex2i( area.left() - FRAME_WIDTH, area.top() - FRAME_WIDTH ); // left frame - glVertex2i( area.left() - 1, area.top() - FRAME_WIDTH ); - glVertex2i( area.left() - 1, area.bottom() + FRAME_WIDTH ); - glVertex2i( area.left() - FRAME_WIDTH, area.bottom() + FRAME_WIDTH ); - glVertex2i( area.right() + 1, area.top() - FRAME_WIDTH ); // right frame - glVertex2i( area.right() + FRAME_WIDTH, area.top() - FRAME_WIDTH ); - glVertex2i( area.right() + FRAME_WIDTH, area.bottom() + FRAME_WIDTH ); - glVertex2i( area.right() + 1, area.bottom() + FRAME_WIDTH ); - glVertex2i( area.left() - FRAME_WIDTH, area.bottom() + 1 ); // bottom frame - glVertex2i( area.right() + FRAME_WIDTH, area.bottom() + 1 ); - glVertex2i( area.right() + FRAME_WIDTH, area.bottom() + FRAME_WIDTH ); - glVertex2i( area.left() - FRAME_WIDTH, area.bottom() + FRAME_WIDTH ); - glEnd(); + glPushAttrib( GL_CURRENT_BIT ); + glColor4f( 0, 0, 0, 1 ); // black + for( PaintClipper::Iterator iterator; + !iterator.isDone(); + iterator.next()) + { + glBegin( GL_QUADS ); + glVertex2i( area.left() - FRAME_WIDTH, area.top() - FRAME_WIDTH ); // top frame + glVertex2i( area.right() + FRAME_WIDTH, area.top() - FRAME_WIDTH ); + glVertex2i( area.right() + FRAME_WIDTH, area.top() - 1 ); + glVertex2i( area.left() - FRAME_WIDTH, area.top() - 1 ); + glVertex2i( area.left() - FRAME_WIDTH, area.top() - FRAME_WIDTH ); // left frame + glVertex2i( area.left() - 1, area.top() - FRAME_WIDTH ); + glVertex2i( area.left() - 1, area.bottom() + FRAME_WIDTH ); + glVertex2i( area.left() - FRAME_WIDTH, area.bottom() + FRAME_WIDTH ); + glVertex2i( area.right() + 1, area.top() - FRAME_WIDTH ); // right frame + glVertex2i( area.right() + FRAME_WIDTH, area.top() - FRAME_WIDTH ); + glVertex2i( area.right() + FRAME_WIDTH, area.bottom() + FRAME_WIDTH ); + glVertex2i( area.right() + 1, area.bottom() + FRAME_WIDTH ); + glVertex2i( area.left() - FRAME_WIDTH, area.bottom() + 1 ); // bottom frame + glVertex2i( area.right() + FRAME_WIDTH, area.bottom() + 1 ); + glVertex2i( area.right() + FRAME_WIDTH, area.bottom() + FRAME_WIDTH ); + glVertex2i( area.left() - FRAME_WIDTH, area.bottom() + FRAME_WIDTH ); + glEnd(); + } + glPopAttrib(); } - glPopAttrib(); +#endif } }