summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp12
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h1
2 files changed, 10 insertions, 3 deletions
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index 95199fa..2f565cf 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -710,16 +710,20 @@ void QGL2PaintEngineEx::beginNativePainting()
#endif
d->lastTexture = GLuint(-1);
+ d->resetGLState();
+ d->needsSync = true;
+}
+
+void QGL2PaintEngineExPrivate::resetGLState()
+{
glDisable(GL_BLEND);
glActiveTexture(GL_TEXTURE0);
-
glDisable(GL_DEPTH_TEST);
+ glDisable(GL_SCISSOR_TEST);
glDepthFunc(GL_LESS);
glDepthMask(true);
glClearDepth(1);
-
- d->needsSync = true;
}
void QGL2PaintEngineEx::endNativePainting()
@@ -1364,6 +1368,8 @@ bool QGL2PaintEngineEx::end()
d->drawable.doneCurrent();
d->ctx->d_ptr->active_engine = 0;
+ d->resetGLState();
+
return false;
}
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
index 2eec4d5..66e7a51 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
@@ -170,6 +170,7 @@ public:
void setBrush(const QBrush* brush);
void transferMode(EngineMode newMode);
+ void resetGLState();
// fill, drawOutline, drawTexture & drawCachedGlyphs are the rendering entry points:
void fill(const QVectorPath &path);