diff options
Diffstat (limited to 'src/opengl')
-rw-r--r-- | src/opengl/gl2paintengineex/qglengineshadermanager_p.h | 3 | ||||
-rw-r--r-- | src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h | 2 | ||||
-rw-r--r-- | src/opengl/qpixmapdata_gl.cpp | 9 |
3 files changed, 7 insertions, 7 deletions
diff --git a/src/opengl/gl2paintengineex/qglengineshadermanager_p.h b/src/opengl/gl2paintengineex/qglengineshadermanager_p.h index 8122a08..884e687 100644 --- a/src/opengl/gl2paintengineex/qglengineshadermanager_p.h +++ b/src/opengl/gl2paintengineex/qglengineshadermanager_p.h @@ -428,10 +428,9 @@ private: QGLShaderProgram* simpleShaderProg; QGLEngineShaderProg* currentShaderProg; - QCache<QByteArray, QGLShader> customShaderCache; - // TODO: Possibly convert to a LUT QList<QGLEngineShaderProg> cachedPrograms; + QCache<QByteArray, QGLShader> customShaderCache; QGLShader* compiledShaders[TotalShaderCount]; diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h index 3ff2dca..6a96877 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h @@ -150,7 +150,7 @@ public: q(q_ptr), width(0), height(0), ctx(0), - currentBrush( &(q->state()->brush) ), + currentBrush(0), inverseScale(1), shaderManager(0) { } diff --git a/src/opengl/qpixmapdata_gl.cpp b/src/opengl/qpixmapdata_gl.cpp index c0eed4d..f9d09b7 100644 --- a/src/opengl/qpixmapdata_gl.cpp +++ b/src/opengl/qpixmapdata_gl.cpp @@ -191,6 +191,8 @@ QGLPixmapData::~QGLPixmapData() if (!shareWidget) return; + delete m_engine; + if (m_texture.id) { QGLShareContextScope ctx(shareWidget->context()); glDeleteTextures(1, &m_texture.id); @@ -463,10 +465,8 @@ void QGLPixmapData::swapBuffers() m_renderFbo->release(); qgl_fbo_pool()->release(m_renderFbo); - delete m_engine; m_renderFbo = 0; - m_engine = 0; } void QGLPixmapData::makeCurrent() @@ -493,7 +493,7 @@ QPaintEngine* QGLPixmapData::paintEngine() const if (!isValid()) return 0; - if (m_engine) + if (m_renderFbo) return m_engine; if (useFramebufferObjects()) { @@ -511,7 +511,8 @@ QPaintEngine* QGLPixmapData::paintEngine() const m_renderFbo = qgl_fbo_pool()->acquire(size(), format); if (m_renderFbo) { - m_engine = new QGL2PaintEngineEx; + if (!m_engine) + m_engine = new QGL2PaintEngineEx; return m_engine; } |