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/qglpaintdevice_p.h | |
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/qglpaintdevice_p.h')
-rw-r--r-- | src/opengl/qglpaintdevice_p.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/opengl/qglpaintdevice_p.h b/src/opengl/qglpaintdevice_p.h index c5fa626..6d34b1b 100644 --- a/src/opengl/qglpaintdevice_p.h +++ b/src/opengl/qglpaintdevice_p.h @@ -66,9 +66,11 @@ public: virtual void ensureActiveTarget(); virtual void endPaint(); - virtual QColor backgroundColor() const; - virtual bool autoFillBackground() const; - virtual bool hasTransparentBackground() const; +// virtual void clearOnBegin() const; +// virtual QColor clearColor() const; +// virtual QColor backgroundColor() const; +// virtual bool autoFillBackground() const; +// virtual bool hasTransparentBackground() const; virtual QGLContext* context() const = 0; QGLFormat format() const; @@ -96,11 +98,13 @@ public: virtual QPaintEngine* paintEngine() const; - virtual QColor backgroundColor() const; - virtual bool autoFillBackground() const; - virtual bool hasTransparentBackground() const; +// virtual void clearOnBegin() const; +// virtual QColor clearColor() const; +// virtual bool autoFillBackground() const; +// virtual bool hasTransparentBackground() const; // QGLWidgets need to do swapBufers in endPaint: + virtual void beginPaint(); virtual void endPaint(); virtual QSize size() const; virtual QGLContext* context() const; |