summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/widgets/kernel/qwidgetbackingstore.cpp51
-rw-r--r--src/widgets/kernel/qwidgetbackingstore_p.h2
2 files changed, 31 insertions, 22 deletions
diff --git a/src/widgets/kernel/qwidgetbackingstore.cpp b/src/widgets/kernel/qwidgetbackingstore.cpp
index d9d1c887c1..334b6cd463 100644
--- a/src/widgets/kernel/qwidgetbackingstore.cpp
+++ b/src/widgets/kernel/qwidgetbackingstore.cpp
@@ -1059,6 +1059,31 @@ static inline bool discardSyncRequest(QWidget *tlw, QTLWExtra *tlwExtra)
return false;
}
+bool QWidgetBackingStore::syncAllowed()
+{
+#ifndef QT_NO_OPENGL
+ QTLWExtra *tlwExtra = tlw->d_func()->maybeTopData();
+ if (textureListWatcher && !textureListWatcher->isLocked()) {
+ textureListWatcher->deleteLater();
+ textureListWatcher = 0;
+ } else if (!tlwExtra->widgetTextures.isEmpty()) {
+ bool skipSync = false;
+ foreach (QPlatformTextureList *tl, tlwExtra->widgetTextures) {
+ if (tl->isLocked()) {
+ if (!textureListWatcher)
+ textureListWatcher = new QPlatformTextureListWatcher(this);
+ if (!textureListWatcher->isLocked())
+ textureListWatcher->watch(tl);
+ skipSync = true;
+ }
+ }
+ if (skipSync) // cannot compose due to widget textures being in use
+ return false;
+ }
+#endif
+ return true;
+}
+
/*!
Synchronizes the \a exposedRegion of the \a exposedWidget with the backing store.
@@ -1089,7 +1114,8 @@ void QWidgetBackingStore::sync(QWidget *exposedWidget, const QRegion &exposedReg
else
markDirtyOnScreen(exposedRegion, exposedWidget, QPoint());
- doSync();
+ if (syncAllowed())
+ doSync();
}
/*!
@@ -1115,27 +1141,8 @@ void QWidgetBackingStore::sync()
return;
}
-#ifndef QT_NO_OPENGL
- if (textureListWatcher && !textureListWatcher->isLocked()) {
- textureListWatcher->deleteLater();
- textureListWatcher = 0;
- } else if (!tlwExtra->widgetTextures.isEmpty()) {
- bool skipSync = false;
- foreach (QPlatformTextureList *tl, tlwExtra->widgetTextures) {
- if (tl->isLocked()) {
- if (!textureListWatcher)
- textureListWatcher = new QPlatformTextureListWatcher(this);
- if (!textureListWatcher->isLocked())
- textureListWatcher->watch(tl);
- skipSync = true;
- }
- }
- if (skipSync) // cannot compose due to widget textures being in use
- return;
- }
-#endif
-
- doSync();
+ if (syncAllowed())
+ doSync();
}
void QWidgetBackingStore::doSync()
diff --git a/src/widgets/kernel/qwidgetbackingstore_p.h b/src/widgets/kernel/qwidgetbackingstore_p.h
index c45e60ef6e..564dc7f245 100644
--- a/src/widgets/kernel/qwidgetbackingstore_p.h
+++ b/src/widgets/kernel/qwidgetbackingstore_p.h
@@ -164,6 +164,8 @@ private:
void updateLists(QWidget *widget);
+ bool syncAllowed();
+
inline void addDirtyWidget(QWidget *widget, const QRegion &rgn)
{
if (widget && !widget->d_func()->inDirtyList && !widget->data->in_destructor) {