Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(566)

Unified Diff: third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp

Issue 2330863003: Switch to null root property tree nodes [spv2] (Closed)
Patch Set: Rebase from space Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp b/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp
index 79321fb3ed5ece415829117039910ffd6c52f24a..9a58e053c121d1d02e7cad32eff3024c0109fae0 100644
--- a/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp
+++ b/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp
@@ -218,9 +218,6 @@ public:
PropertyTreeManager(cc::PropertyTrees& propertyTrees, cc::Layer* rootLayer)
: m_propertyTrees(propertyTrees)
, m_rootLayer(rootLayer)
-#if DCHECK_IS_ON()
- , m_isFirstEffectEver(true)
-#endif
{
m_effectStack.append(BlinkEffectAndCcIdPair{nullptr, kSecondaryRootNodeId});
}
@@ -230,7 +227,7 @@ public:
int compositorIdForTransformNode(const TransformPaintPropertyNode*);
int compositorIdForClipNode(const ClipPaintPropertyNode*);
- int switchToEffectNode(const EffectPaintPropertyNode& nextEffect);
+ int switchToEffectNode(const EffectPaintPropertyNode* nextEffect);
int compositorIdForCurrentEffectNode() const { return m_effectStack.last().id; }
int compositorIdForScrollNode(const ScrollPaintPropertyNode*);
@@ -267,7 +264,6 @@ private:
#if DCHECK_IS_ON()
HashSet<const EffectPaintPropertyNode*> m_effectNodesConverted;
- bool m_isFirstEffectEver;
#endif
};
@@ -435,17 +431,16 @@ const EffectPaintPropertyNode* lowestCommonAncestor(const EffectPaintPropertyNod
return nodeA;
}
-int PropertyTreeManager::switchToEffectNode(const EffectPaintPropertyNode& nextEffect)
+int PropertyTreeManager::switchToEffectNode(const EffectPaintPropertyNode* nextEffect)
{
- const EffectPaintPropertyNode* ancestor = lowestCommonAncestor(currentEffectNode(), &nextEffect);
+ const EffectPaintPropertyNode* ancestor = lowestCommonAncestor(currentEffectNode(), nextEffect);
while (currentEffectNode() != ancestor)
m_effectStack.removeLast();
-#if DCHECK_IS_ON()
- DCHECK(m_isFirstEffectEver || currentEffectNode()) << "Malformed effect tree. Nodes in the same property tree should have common root.";
- m_isFirstEffectEver = false;
-#endif
- buildEffectNodesRecursively(&nextEffect);
+ if (!nextEffect)
+ return kSecondaryRootNodeId;
+
+ buildEffectNodesRecursively(nextEffect);
return compositorIdForCurrentEffectNode();
}
@@ -525,7 +520,7 @@ void PaintArtifactCompositor::update(const PaintArtifact& paintArtifact)
int transformId = propertyTreeManager.compositorIdForTransformNode(paintChunk.properties.transform.get());
int scrollId = propertyTreeManager.compositorIdForScrollNode(paintChunk.properties.scroll.get());
int clipId = propertyTreeManager.compositorIdForClipNode(paintChunk.properties.clip.get());
- int effectId = propertyTreeManager.switchToEffectNode(*paintChunk.properties.effect.get());
+ int effectId = propertyTreeManager.switchToEffectNode(paintChunk.properties.effect.get());
propertyTreeManager.updateScrollOffset(layer->id(), scrollId);
« no previous file with comments | « third_party/WebKit/Source/core/paint/PrePaintTreeWalk.cpp ('k') | third_party/WebKit/Source/platform/graphics/paint/README.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698