summaryrefslogtreecommitdiffstats
path: root/src/opengl/qpixmapdata_gl.cpp
diff options
context:
space:
mode:
authorSamuel Rødal <sroedal@trolltech.com>2009-09-15 10:27:37 (GMT)
committerSamuel Rødal <sroedal@trolltech.com>2009-09-15 10:46:41 (GMT)
commitaf1cfbc945c7c01adea09d3d369699f4dd0daab9 (patch)
tree24a9f3e32e12955d2a1a725dc54d6e0604ed50bb /src/opengl/qpixmapdata_gl.cpp
parentf60e8c21c1d031daa8984461f9e5a6988e3ce2e7 (diff)
downloadQt-af1cfbc945c7c01adea09d3d369699f4dd0daab9.zip
Qt-af1cfbc945c7c01adea09d3d369699f4dd0daab9.tar.gz
Qt-af1cfbc945c7c01adea09d3d369699f4dd0daab9.tar.bz2
Fixed rendering errors in blurpicker with -graphicssystem opengl
1) Need to transfer to brush drawing mode when switching active engine, to make sure we reset the vertex / texture coordinate pointers for image drawing. 2) QGLPixmapGLPaintDevice::beginPaint() was changed to use QGLContext::drawTexture() for blitting the old texture contents to the render FBO, which means that we also need to set up viewport, modelview, and projection matrices, and ensure that clipping / stencil testing is disabled. 3) Make sure stencil testing is disabled when clearing the FBO. Reviewed-by: Tom
Diffstat (limited to 'src/opengl/qpixmapdata_gl.cpp')
-rw-r--r--src/opengl/qpixmapdata_gl.cpp16
1 files changed, 15 insertions, 1 deletions
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));
}
}