summaryrefslogtreecommitdiffstats
path: root/src/opengl/gl2paintengineex
diff options
context:
space:
mode:
authorTom Cooksey <thomas.cooksey@nokia.com>2009-09-08 13:09:00 (GMT)
committerTom Cooksey <thomas.cooksey@nokia.com>2009-09-08 16:36:16 (GMT)
commit31d8058a32a1d2d2d6bc1ba3d48f5a382d7b87a7 (patch)
treee9402324bd0eadd51802a3df9b43157639f01123 /src/opengl/gl2paintengineex
parente3e7cf545116c194bd5cfe79b28ea37c8bf78219 (diff)
downloadQt-31d8058a32a1d2d2d6bc1ba3d48f5a382d7b87a7.zip
Qt-31d8058a32a1d2d2d6bc1ba3d48f5a382d7b87a7.tar.gz
Qt-31d8058a32a1d2d2d6bc1ba3d48f5a382d7b87a7.tar.bz2
Make QGLPixmapData work with the new QGLPaintDevice API
This patch changes the ordering of QGL2PaintEngine::begin a bit because QGLPixmapData needs to use the paint engine's drawTexture method within beginPaint(). Also, this initialises needsSync to true and removes the setState call. So now all the state initialisation is done in ensureActive rather than begin.
Diffstat (limited to 'src/opengl/gl2paintengineex')
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp24
1 files changed, 4 insertions, 20 deletions
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index c280803..e028e63 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -1321,7 +1321,6 @@ bool QGL2PaintEngineEx::begin(QPaintDevice *pdev)
d->ctx->d_ptr->active_engine = this;
d->last_created_state = 0;
- d->device->beginPaint();
QSize sz = d->device->size();
d->width = sz.width();
d->height = sz.height();
@@ -1333,8 +1332,6 @@ bool QGL2PaintEngineEx::begin(QPaintDevice *pdev)
d->shaderManager = new QGLEngineShaderManager(d->ctx);
- glViewport(0, 0, d->width, d->height);
-
d->brushTextureDirty = true;
d->brushUniformsDirty = true;
d->matrixDirty = true;
@@ -1343,10 +1340,12 @@ bool QGL2PaintEngineEx::begin(QPaintDevice *pdev)
d->simpleShaderDepthUniformDirty = true;
d->depthUniformDirty = true;
d->opacityUniformDirty = true;
- d->needsSync = false;
-
+ d->needsSync = true;
d->use_system_clip = !systemClip().isEmpty();
+
+ d->device->beginPaint();
+
if (!d->inRenderText) {
glDisable(GL_DEPTH_TEST);
glDisable(GL_SCISSOR_TEST);
@@ -1358,21 +1357,6 @@ bool QGL2PaintEngineEx::begin(QPaintDevice *pdev)
glDisable(GL_MULTISAMPLE);
#endif
-// QGLPixmapData *source = d->drawable.copyOnBegin();
-// if (source) {
-// QGLContext *ctx = d->ctx;
-//
-// d->transferMode(ImageDrawingMode);
-//
-// glActiveTexture(GL_TEXTURE0 + QT_IMAGE_TEXTURE_UNIT);
-// source->bind(false);
-//
-// QRect rect(0, 0, source->width(), source->height());
-// d->updateTextureFilter(GL_TEXTURE_2D, GL_REPEAT, false);
-// d->drawTexture(QRectF(rect), QRectF(rect), rect.size(), true);
-// }
-
- d->systemStateChanged();
return true;
}