Put OpenGL commands in magnifier in #ifdef KWIN_HAVE_OPENGL_COMPOSITING and effects->compositingType() == KWin::OpenGLCompositing.

svn path=/trunk/KDE/kdebase/workspace/; revision=960004
This commit is contained in:
Martin Gräßlin 2009-04-27 18:34:05 +00:00
parent 1b728c3337
commit 8f19fcd767

View file

@ -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
}
}