diff options
Diffstat (limited to 'src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp')
-rw-r--r-- | src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index 0c01263..7271740 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -316,6 +316,7 @@ extern QImage qt_imageForBrush(int brushStyle, bool invert); QGL2PaintEngineExPrivate::~QGL2PaintEngineExPrivate() { + delete shaderManager; } void QGL2PaintEngineExPrivate::updateTextureFilter(GLenum target, GLenum wrapMode, bool smoothPixmapTransform, GLuint id) @@ -1330,7 +1331,8 @@ bool QGL2PaintEngineEx::begin(QPaintDevice *pdev) qt_resolve_version_2_0_functions(d->ctx); #endif - d->shaderManager = QGLEngineShaderManager::managerForContext(d->ctx); + if (!d->shaderManager) + d->shaderManager = new QGLEngineShaderManager(d->ctx); d->shaderManager->setDirty(); glViewport(0, 0, d->width, d->height); @@ -1430,11 +1432,13 @@ void QGL2PaintEngineEx::ensureActive() p->transferMode(BrushDrawingMode); p->drawable.doneCurrent(); } + d->drawable.context()->makeCurrent(); d->drawable.makeCurrent(); ctx->d_ptr->active_engine = this; - d->needsSync = true; + } else { + d->drawable.context()->makeCurrent(); } if (d->needsSync) { |