diff options
author | Tom Cooksey <thomas.cooksey@nokia.com> | 2009-09-07 08:58:31 (GMT) |
---|---|---|
committer | Tom Cooksey <thomas.cooksey@nokia.com> | 2009-09-08 16:36:15 (GMT) |
commit | 4feed48fdd738ed99cba86a4214e238a3e7275ed (patch) | |
tree | a9b3b41bc838275d56914b7f0d22e739794ae3c4 /src/opengl/qpaintengine_opengl.cpp | |
parent | e8b5bfa8a86b2d7c79aabcc4566f740f0a9afe7c (diff) | |
download | Qt-4feed48fdd738ed99cba86a4214e238a3e7275ed.zip Qt-4feed48fdd738ed99cba86a4214e238a3e7275ed.tar.gz Qt-4feed48fdd738ed99cba86a4214e238a3e7275ed.tar.bz2 |
Move buffer clear out of the paint engine and into the QGLPaintDevices
Previously, the paint engine cleared the surface's buffers in begin.
This logic really belongs in QGLPaintDevice::beginPaint as not all paint
devices will want this behaviour (in fact most don't). This also makes
QGLPaintDevice API much simpler as the virtual getters for the clear
color, etc. can be removed. It's much cleaner this way. The only
possible problem is with the GL1 engine, which also cleared the
accumulation & depth buffers in begin. However, the engine will also
clear the depth buffer later as part of it's clipping logic. It also
doesn't use the accumulation buffer, so clearing it seems unnessisary.
Diffstat (limited to 'src/opengl/qpaintengine_opengl.cpp')
-rw-r--r-- | src/opengl/qpaintengine_opengl.cpp | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/src/opengl/qpaintengine_opengl.cpp b/src/opengl/qpaintengine_opengl.cpp index 634067d..36a0081 100644 --- a/src/opengl/qpaintengine_opengl.cpp +++ b/src/opengl/qpaintengine_opengl.cpp @@ -1349,22 +1349,6 @@ bool QOpenGLPaintEngine::begin(QPaintDevice *pdev) d->offscreen.begin(); - if (d->device->context()->d_func()->clear_on_painter_begin && d->device->autoFillBackground()) { - - if (d->device->hasTransparentBackground()) - glClearColor(0.0, 0.0, 0.0, 0.0); - else { - const QColor &c = d->device->backgroundColor(); - glClearColor(c.redF(), c.greenF(), c.blueF(), 1.0); - } - - GLbitfield clearBits = GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT; -#ifndef QT_OPENGL_ES - clearBits |= GL_ACCUM_BUFFER_BIT; -#endif - glClear(clearBits); - } - QSize sz(d->device->size()); glViewport(0, 0, sz.width(), sz.height()); // XXX (Embedded): We need a solution for GLWidgets that draw in a part or a bigger surface... glMatrixMode(GL_PROJECTION); |