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/gl2paintengineex | |
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/gl2paintengineex')
-rw-r--r-- | src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index fcfd818..c280803 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -1359,17 +1359,7 @@ bool QGL2PaintEngineEx::begin(QPaintDevice *pdev) #endif // QGLPixmapData *source = d->drawable.copyOnBegin(); - if (d->ctx->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(); - float alpha = c.alphaF(); - glClearColor(c.redF() * alpha, c.greenF() * alpha, c.blueF() * alpha, alpha); - } - glClear(GL_COLOR_BUFFER_BIT); - } -// else if (source) { +// if (source) { // QGLContext *ctx = d->ctx; // // d->transferMode(ImageDrawingMode); |