diff options
Diffstat (limited to 'src/opengl')
-rw-r--r-- | src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp | 1 | ||||
-rw-r--r-- | src/opengl/qpixmapdata_gl.cpp | 16 |
2 files changed, 16 insertions, 1 deletions
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index 5e790cf..e41d0b4 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -1385,6 +1385,7 @@ void QGL2PaintEngineEx::ensureActive() d->device->ensureActiveTarget(); if (d->needsSync) { + d->transferMode(BrushDrawingMode); glViewport(0, 0, d->width, d->height); glDepthMask(false); glDepthFunc(GL_LESS); diff --git a/src/opengl/qpixmapdata_gl.cpp b/src/opengl/qpixmapdata_gl.cpp index 0bc46e1..d5398a9 100644 --- a/src/opengl/qpixmapdata_gl.cpp +++ b/src/opengl/qpixmapdata_gl.cpp @@ -149,6 +149,7 @@ void QGLPixmapGLPaintDevice::beginPaint() if (data->needsFill()) { const QColor &c = data->fillColor(); float alpha = c.alphaF(); + glDisable(GL_SCISSOR_TEST); glClearColor(c.redF() * alpha, c.greenF() * alpha, c.blueF() * alpha, alpha); glClear(GL_COLOR_BUFFER_BIT); } @@ -157,8 +158,21 @@ void QGLPixmapGLPaintDevice::beginPaint() // uploaded from an image or rendered into before), we need to // copy it from the texture to the render FBO. + glDisable(GL_DEPTH_TEST); + glDisable(GL_SCISSOR_TEST); + glDisable(GL_BLEND); + + glMatrixMode(GL_MODELVIEW_MATRIX); + glLoadIdentity(); + + glMatrixMode(GL_PROJECTION_MATRIX); + glLoadIdentity(); + glOrtho(0, data->width(), data->height(), 0, -999999, 999999); + + glViewport(0, 0, data->width(), data->height()); + // Pass false to bind so it doesn't copy the FBO into the texture! - context()->drawTexture(QPointF(0.0, 0.0), data->bind(false)); + context()->drawTexture(QRect(0, 0, data->width(), data->height()), data->bind(false)); } } |