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

Unified Diff: third_party/WebKit/Source/platform/graphics/paint/PropertyTreeState.cpp

Issue 2637383006: Set layer element id when building layers in PaintArtifactCompositor. (Closed)
Patch Set: Sync to head. Created 3 years, 11 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/paint/PropertyTreeState.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/paint/PropertyTreeState.cpp b/third_party/WebKit/Source/platform/graphics/paint/PropertyTreeState.cpp
index 852b5243edb25b2eb73911ebda9fa37f3370faaf..c350165afdf9f5b5e9b38841ea35bf4682d9d76d 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/PropertyTreeState.cpp
+++ b/third_party/WebKit/Source/platform/graphics/paint/PropertyTreeState.cpp
@@ -29,6 +29,36 @@ bool isAncestorOf(const PropertyNode* ancestor, const PropertyNode* child) {
return child == ancestor;
}
+const CompositorElementId PropertyTreeState::compositorElementId() const {
+// Zero or more of the scroll, effect or transform nodes could have a
+// compositor element id. The order doesn't matter as the element id should be
+// the same on all that have a non-default CompositorElementId.
+#if DCHECK_IS_ON()
+ CompositorElementId expectedElementId;
+ if (CompositorElementId actualElementId = effect()->compositorElementId()) {
+ expectedElementId = actualElementId;
+ }
+ if (CompositorElementId actualElementId = scroll()->compositorElementId()) {
+ if (!expectedElementId)
+ expectedElementId = actualElementId;
+ else
+ DCHECK_EQ(expectedElementId, actualElementId);
+ }
+ if (CompositorElementId actualElementId =
+ transform()->compositorElementId()) {
+ if (expectedElementId)
+ DCHECK_EQ(expectedElementId, actualElementId);
+ }
+#endif
+ if (effect()->compositorElementId())
+ return effect()->compositorElementId();
+ if (scroll()->compositorElementId())
+ return scroll()->compositorElementId();
+ if (transform()->compositorElementId())
+ return transform()->compositorElementId();
+ return CompositorElementId();
+}
+
PropertyTreeState::InnermostNode PropertyTreeState::innermostNode() const {
// TODO(chrishtr): this is very inefficient when innermostNode() is called
// repeatedly.

Powered by Google App Engine
This is Rietveld 408576698