forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -77,8 +77,15 @@ void Qt5RenderNodeInstanceServer::collectItemChangesAndSendChangeCommands()
|
|||||||
DesignerSupport::polishItems(quickWindow());
|
DesignerSupport::polishItems(quickWindow());
|
||||||
|
|
||||||
if (quickWindow() && nodeInstanceClient()->bytesToWrite() < 10000) {
|
if (quickWindow() && nodeInstanceClient()->bytesToWrite() < 10000) {
|
||||||
|
bool windowDirty = false;
|
||||||
foreach (QQuickItem *item, allItems()) {
|
foreach (QQuickItem *item, allItems()) {
|
||||||
if (item) {
|
if (item) {
|
||||||
|
if (Internal::QuickItemNodeInstance::unifiedRenderPath()) {
|
||||||
|
if (DesignerSupport::isDirty(item, DesignerSupport::AllMask)) {
|
||||||
|
windowDirty = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
if (hasInstanceForObject(item)) {
|
if (hasInstanceForObject(item)) {
|
||||||
if (DesignerSupport::isDirty(item, DesignerSupport::ContentUpdateMask))
|
if (DesignerSupport::isDirty(item, DesignerSupport::ContentUpdateMask))
|
||||||
m_dirtyInstanceSet.insert(instanceForObject(item));
|
m_dirtyInstanceSet.insert(instanceForObject(item));
|
||||||
@@ -90,6 +97,7 @@ void Qt5RenderNodeInstanceServer::collectItemChangesAndSendChangeCommands()
|
|||||||
Internal::QuickItemNodeInstance::updateDirtyNode(item);
|
Internal::QuickItemNodeInstance::updateDirtyNode(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
clearChangedPropertyList();
|
clearChangedPropertyList();
|
||||||
|
|
||||||
@@ -97,6 +105,7 @@ void Qt5RenderNodeInstanceServer::collectItemChangesAndSendChangeCommands()
|
|||||||
/* QQuickItem::grabToImage render path */
|
/* QQuickItem::grabToImage render path */
|
||||||
/* TODO implement QQuickItem::grabToImage based rendering */
|
/* TODO implement QQuickItem::grabToImage based rendering */
|
||||||
/* sheduleRootItemRender(); */
|
/* sheduleRootItemRender(); */
|
||||||
|
if (windowDirty)
|
||||||
nodeInstanceClient()->pixmapChanged(createPixmapChangedCommand({rootNodeInstance()}));
|
nodeInstanceClient()->pixmapChanged(createPixmapChangedCommand({rootNodeInstance()}));
|
||||||
} else {
|
} else {
|
||||||
if (!m_dirtyInstanceSet.isEmpty()) {
|
if (!m_dirtyInstanceSet.isEmpty()) {
|
||||||
|
Reference in New Issue
Block a user