path: root/src/gui/painting/qplatformbackingstore.h
diff options
authorLaszlo Agocs <>2014-12-12 12:59:43 +0100
committerKai Koehne <>2014-12-18 09:46:23 +0100
commit6c2da36c22e25e626a9812419332ad379e854133 (patch)
tree63b70bc1fce47768f262b3793d93338f42bfd79f /src/gui/painting/qplatformbackingstore.h
parentb8e71aa8477765008798d4bd7887244cb4cc2db7 (diff)
Prevent continuous painting with viewport QOpenGLWidget
Add the source widget to the texture list (may be null for custom compositor implementations that add textures not belonging to actual widgets). This allows us to do proper checks with the dirtyRenderToTextureWidgets list. As a result paint events are only sent to a QOpenGLWidget if (1) there was an update() for it or (2) it was actually marked dirty. (2) was previously behaving differently: the widget got a paint event when anything in the window has changed. This is fine for naive animating OpenGL code but less ideal for QGraphicsView. Bool properties like stacksOnTop are now stored in a flags value to prevent future explosion of texture list fields and parameters. Task-number: QTBUG-43178 Change-Id: I48cbcf93df72ac682c9b5d64982a8b648fe21ef3 Reviewed-by: Jørgen Lind <> Reviewed-by: Paul Olav Tvete <>
Diffstat (limited to 'src/gui/painting/qplatformbackingstore.h')
1 files changed, 9 insertions, 2 deletions
diff --git a/src/gui/painting/qplatformbackingstore.h b/src/gui/painting/qplatformbackingstore.h
index 52c263f05d..c69612ca44 100644
--- a/src/gui/painting/qplatformbackingstore.h
+++ b/src/gui/painting/qplatformbackingstore.h
@@ -69,6 +69,11 @@ class Q_GUI_EXPORT QPlatformTextureList : public QObject
+ enum Flag {
+ StacksOnTop = 0x01
+ };
+ Q_DECLARE_FLAGS(Flags, Flag)
explicit QPlatformTextureList(QObject *parent = 0);
@@ -76,16 +81,18 @@ public:
bool isEmpty() const { return count() == 0; }
GLuint textureId(int index) const;
QRect geometry(int index) const;
- bool stacksOnTop(int index) const;
+ QWidget *widget(int index);
+ Flags flags(int index) const;
void lock(bool on);
bool isLocked() const;
- void appendTexture(GLuint textureId, const QRect &geometry, bool stacksOnTop = false);
+ void appendTexture(QWidget *widget, GLuint textureId, const QRect &geometry, Flags flags = 0);
void clear();
void locked(bool);
class Q_GUI_EXPORT QPlatformBackingStore