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); |