diff --git a/effects/showpaint/showpaint.cpp b/effects/showpaint/showpaint.cpp index 3119119fbc..24ce704dcf 100644 --- a/effects/showpaint/showpaint.cpp +++ b/effects/showpaint/showpaint.cpp @@ -45,26 +45,11 @@ static QColor colors[] = { Qt::red, Qt::green, Qt::blue, Qt::cyan, Qt::magenta, ShowPaintEffect::ShowPaintEffect() : color_index( 0 ) -#ifdef KWIN_HAVE_OPENGL_COMPOSITING - , vbo( 0 ) -#endif { -#ifdef KWIN_HAVE_OPENGL_COMPOSITING - if (effects->compositingType() == OpenGLCompositing) { - vbo = new GLVertexBuffer(GLVertexBuffer::Stream); - vbo->setUseColor(true); - if (ShaderManager::instance()->isValid()) { - vbo->setUseShader(true); - } - } -#endif } ShowPaintEffect::~ShowPaintEffect() { -#ifdef KWIN_HAVE_OPENGL_COMPOSITING - delete vbo; -#endif } void ShowPaintEffect::paintScreen( int mask, QRegion region, ScreenPaintData& data ) @@ -95,8 +80,12 @@ void ShowPaintEffect::paintGL() #ifndef KWIN_HAVE_OPENGLES glPushAttrib( GL_CURRENT_BIT | GL_ENABLE_BIT ); #endif + GLVertexBuffer *vbo = GLVertexBuffer::streamingBuffer(); + vbo->reset(); + vbo->setUseColor(true); if (ShaderManager::instance()->isValid()) { ShaderManager::instance()->pushShader(ShaderManager::ColorShader); + vbo->setUseShader(true); } glEnable( GL_BLEND ); glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); diff --git a/effects/showpaint/showpaint.h b/effects/showpaint/showpaint.h index cba8afa738..26055c35b1 100644 --- a/effects/showpaint/showpaint.h +++ b/effects/showpaint/showpaint.h @@ -25,7 +25,6 @@ along with this program. If not, see . namespace KWin { -class GLVertexBuffer; class ShowPaintEffect : public Effect @@ -40,9 +39,6 @@ class ShowPaintEffect void paintXrender(); QRegion painted; // what's painted in one pass int color_index; -#ifdef KWIN_HAVE_OPENGL_COMPOSITING - GLVertexBuffer *vbo; -#endif }; } // namespace