aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKnud Dollereder <knud.dollereder@qt.io>2021-07-14 16:12:23 +0200
committerKnud Dollereder <knud.dollereder@qt.io>2021-07-14 20:54:29 +0000
commit30f6084f0d3c803c785ec7e5e4e55b40ccb62f07 (patch)
tree5767c1fa81d2d5d502726e48ad50ce3245e12210
parentcc1375baa10575000507ac2b51f70d4c9aa020a9 (diff)
Execute pixmapChangedCommands only if items have changed
This patch prevents continuous image updates by making sure to only execute pixmapChangedCommnds if an item is dirty. Change-Id: Icadc1d8a2a2298d18147b31fbed3fbc4205f0ea8 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
-rw-r--r--share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5rendernodeinstanceserver.cpp23
1 files changed, 16 insertions, 7 deletions
diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5rendernodeinstanceserver.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5rendernodeinstanceserver.cpp
index bb1aa72445..63dba600d5 100644
--- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5rendernodeinstanceserver.cpp
+++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5rendernodeinstanceserver.cpp
@@ -77,17 +77,25 @@ void Qt5RenderNodeInstanceServer::collectItemChangesAndSendChangeCommands()
DesignerSupport::polishItems(quickWindow());
if (quickWindow() && nodeInstanceClient()->bytesToWrite() < 10000) {
+ bool windowDirty = false;
foreach (QQuickItem *item, allItems()) {
if (item) {
- if (hasInstanceForObject(item)) {
+ if (Internal::QuickItemNodeInstance::unifiedRenderPath()) {
+ if (DesignerSupport::isDirty(item, DesignerSupport::AllMask)) {
+ windowDirty = true;
+ break;
+ }
+ } else {
+ if (hasInstanceForObject(item)) {
if (DesignerSupport::isDirty(item, DesignerSupport::ContentUpdateMask))
m_dirtyInstanceSet.insert(instanceForObject(item));
- } else if (DesignerSupport::isDirty(item, DesignerSupport::AllMask)) {
- ServerNodeInstance ancestorInstance = findNodeInstanceForItem(item->parentItem());
- if (ancestorInstance.isValid())
- m_dirtyInstanceSet.insert(ancestorInstance);
+ } else if (DesignerSupport::isDirty(item, DesignerSupport::AllMask)) {
+ ServerNodeInstance ancestorInstance = findNodeInstanceForItem(item->parentItem());
+ if (ancestorInstance.isValid())
+ m_dirtyInstanceSet.insert(ancestorInstance);
+ }
+ Internal::QuickItemNodeInstance::updateDirtyNode(item);
}
- Internal::QuickItemNodeInstance::updateDirtyNode(item);
}
}
@@ -97,7 +105,8 @@ void Qt5RenderNodeInstanceServer::collectItemChangesAndSendChangeCommands()
/* QQuickItem::grabToImage render path */
/* TODO implement QQuickItem::grabToImage based rendering */
/* sheduleRootItemRender(); */
- nodeInstanceClient()->pixmapChanged(createPixmapChangedCommand({rootNodeInstance()}));
+ if (windowDirty)
+ nodeInstanceClient()->pixmapChanged(createPixmapChangedCommand({rootNodeInstance()}));
} else {
if (!m_dirtyInstanceSet.isEmpty()) {
nodeInstanceClient()->pixmapChanged(