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

Unified Diff: third_party/WebKit/Source/platform/graphics/CompositorElementId.h

Issue 2890953002: [SPv1] Always set a CompositorElementId on main graphics layers; use PaintLayer id. (Closed)
Patch Set: none Created 3 years, 7 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/CompositorElementId.h
diff --git a/third_party/WebKit/Source/platform/graphics/CompositorElementId.h b/third_party/WebKit/Source/platform/graphics/CompositorElementId.h
index 8ff066b4aba425245c0c67cd22ac20100975777b..42b99f0032713de470ebd7b673c096fbcc73e281 100644
--- a/third_party/WebKit/Source/platform/graphics/CompositorElementId.h
+++ b/third_party/WebKit/Source/platform/graphics/CompositorElementId.h
@@ -17,19 +17,36 @@ const int kCompositorNamespaceBitCount = 3;
enum class CompositorElementIdNamespace {
kPrimary,
+ kRootScroll,
kScroll,
+ kScrollbar,
+ kScrollState,
kViewport,
kLinkHighlight,
- kScrollbar,
+ kPrimaryCompositorProxy,
+ kScrollCompositorProxy,
// A sentinel to indicate the maximum representable namespace id
// (the maximum is one less than this value).
kMaxRepresentableNamespaceId = 1 << kCompositorNamespaceBitCount
};
using CompositorElementId = cc::ElementId;
-using DOMNodeId = uint64_t;
+using PaintLayerId = uint64_t;
using ScrollbarId = uint64_t;
+using DOMNodeId = uint64_t;
+
+CompositorElementId PLATFORM_EXPORT
+ CompositorElementIdFromPaintLayerId(PaintLayerId,
+ CompositorElementIdNamespace);
+
+// This method should only be used for "special" layers that are not allocated
+// during the normal lifecycle. Examples include VisualViewport,
+// root scrolling (when rootLayerScrollingEnabled is off), and LinkHighlight,
+// or when CompositorProxies are involved.
+// Otherwise, CompositorElementIdFromPaintLayerId is preferred for performance
+// reasons (since computing a DOMNodeId requires a hash map lookup),
+// and future compatibility with multicol/pagination.
CompositorElementId PLATFORM_EXPORT
CompositorElementIdFromDOMNodeId(DOMNodeId, CompositorElementIdNamespace);

Powered by Google App Engine
This is Rietveld 408576698