From a16f7f067200b5c1af7881f8b16af5e3472b7fbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Sun, 29 Aug 2010 11:27:57 +0000 Subject: [PATCH] Only use lanczos if the window size does not exceed the FBO size. svn path=/trunk/KDE/kdebase/workspace/; revision=1169481 --- lanczosfilter.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lanczosfilter.cpp b/lanczosfilter.cpp index cd5de10ddc..3d450383e2 100644 --- a/lanczosfilter.cpp +++ b/lanczosfilter.cpp @@ -182,7 +182,9 @@ void LanczosFilter::performPaint( EffectWindowImpl* w, int mask, QRegion region, { if (!m_inited) init(); - if ( m_shader ) + const QRect screenRect = Workspace::self()->clientArea( ScreenArea, w->screen(), w->desktop() ); + // window geometry may not be bigger than screen geometry to fit into the FBO + if ( m_shader && w->width() <= screenRect.width() && w->height() <= screenRect.height() ) { double left = 0; double top = 0; @@ -198,6 +200,15 @@ void LanczosFilter::performPaint( EffectWindowImpl* w, int mask, QRegion region, } double width = right - left; double height = bottom - top; + if( width > screenRect.width() || height > screenRect.height() ) + { + // window with padding does not fit into the framebuffer + // so cut of the shadow + left = 0; + top = 0; + width = w->width(); + height = w->height(); + } int tx = data.xTranslate + w->x() + left*data.xScale; int ty = data.yTranslate + w->y() + top*data.yScale; int tw = width*data.xScale;