From b840fa0792f582497f188d6064aa2c0d2decb7cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Wed, 7 May 2008 13:05:46 +0000 Subject: [PATCH] Disable copying by value for GLTexture, as it wouldn't work anyway. CCMAIL: Rivo Laks svn path=/trunk/KDE/kdebase/workspace/; revision=805056 --- effects/presentwindows.cpp | 11 +++++------ effects/presentwindows.h | 2 +- lib/kwinglutils.h | 3 +++ 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/effects/presentwindows.cpp b/effects/presentwindows.cpp index 3947238896..28d4a0e8ed 100644 --- a/effects/presentwindows.cpp +++ b/effects/presentwindows.cpp @@ -1033,15 +1033,14 @@ void PresentWindowsEffect::paintWindowIcon( EffectWindow* w, WindowPaintData& pa } WindowData& data = mWindowData[ w ]; - // TODO: find out why this doesn't work properly - // if( data.icon.cacheKey() != w->icon().cacheKey()) + if( data.icon.cacheKey() != w->icon().cacheKey()) { // make sure data.icon is the right QPixmap, and rebind data.icon = w->icon(); #ifdef KWIN_HAVE_OPENGL_COMPOSITING if( effects->compositingType() == OpenGLCompositing ) { - data.iconTexture.load( data.icon ); - data.iconTexture.setFilter( GL_LINEAR ); + data.iconTexture = new GLTexture( data.icon ); + data.iconTexture->setFilter( GL_LINEAR ); } #endif #ifdef KWIN_HAVE_XRENDER_COMPOSITING @@ -1071,7 +1070,7 @@ void PresentWindowsEffect::paintWindowIcon( EffectWindow* w, WindowPaintData& pa // Render the icon glColor4f( 1, 1, 1, 1 * mActiveness ); glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); - data.iconTexture.bind(); + data.iconTexture->bind(); const float verts[ 4 * 2 ] = { x, y, @@ -1087,7 +1086,7 @@ void PresentWindowsEffect::paintWindowIcon( EffectWindow* w, WindowPaintData& pa 1, 1 }; renderGLGeometry( 4, verts, texcoords ); - data.iconTexture.unbind(); + data.iconTexture->unbind(); glPopAttrib(); } #endif diff --git a/effects/presentwindows.h b/effects/presentwindows.h index 14fb5e2b40..d9f3c83c58 100644 --- a/effects/presentwindows.h +++ b/effects/presentwindows.h @@ -118,7 +118,7 @@ class PresentWindowsEffect int slot_distance; QPixmap icon; #ifdef KWIN_HAVE_OPENGL_COMPOSITING - GLTexture iconTexture; + KSharedPtr< GLTexture > iconTexture; #endif #ifdef KWIN_HAVE_XRENDER_COMPOSITING Picture iconPicture; diff --git a/lib/kwinglutils.h b/lib/kwinglutils.h index 6c43d08cc4..ec2bd62195 100644 --- a/lib/kwinglutils.h +++ b/lib/kwinglutils.h @@ -30,6 +30,7 @@ along with this program. If not, see . #include #include +#include /** @addtogroup kwineffects */ /** @{ */ @@ -103,6 +104,7 @@ KWIN_EXPORT void renderRoundBoxWithEdge( const QRect& area, float roundness = 10 class KWIN_EXPORT GLTexture + : public QSharedData { public: GLTexture(); @@ -159,6 +161,7 @@ class KWIN_EXPORT GLTexture static bool mNPOTTextureSupported; static bool mFramebufferObjectSupported; static bool mSaturationSupported; + Q_DISABLE_COPY( GLTexture ) }; class KWIN_EXPORT GLShader