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

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

Issue 2877033002: Fix cc scrollbar layer issues with initialization, and use element ids throughout. (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 df3954953bf83844c7cc5b04bddbb4f5a60de2a8..bf33e3a6aa662f0f2b57fc934faa7dd817beeaab 100644
--- a/third_party/WebKit/Source/platform/graphics/CompositorElementId.h
+++ b/third_party/WebKit/Source/platform/graphics/CompositorElementId.h
@@ -13,20 +13,29 @@
namespace blink {
-enum class CompositorSubElementId {
+const int kCompositorNamespaceBitCount = 3;
+
+enum class CompositorElementIdNamespace {
kPrimary,
kScroll,
kViewport,
kLinkHighlight,
- // A sentinel to indicate how many enum values there are.
- kNumSubElementTypes
+ kScrollbar,
+ // 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 ScrollbarId = uint64_t;
+
+CompositorElementId PLATFORM_EXPORT
+ CompositorElementIdFromDOMNodeId(DOMNodeId, CompositorElementIdNamespace);
CompositorElementId PLATFORM_EXPORT
- CreateCompositorElementId(DOMNodeId, CompositorSubElementId);
+ CompositorElementIdFromScrollbarId(ScrollbarId,
+ CompositorElementIdNamespace);
// Note cc::ElementId has a hash function already implemented via
// ElementIdHash::operator(). However for consistency's sake we choose to use
@@ -42,9 +51,9 @@ struct CompositorElementIdHash {
static const bool safe_to_compare_to_empty_or_deleted = true;
};
-DOMNodeId PLATFORM_EXPORT DomNodeIdFromCompositorElementId(CompositorElementId);
-CompositorSubElementId PLATFORM_EXPORT
- SubElementIdFromCompositorElementId(CompositorElementId);
+uint64_t PLATFORM_EXPORT IdFromCompositorElementId(CompositorElementId);
+CompositorElementIdNamespace PLATFORM_EXPORT
+ NamespaceFromCompositorElementId(CompositorElementId);
struct CompositorElementIdHashTraits
: WTF::GenericHashTraits<CompositorElementId> {

Powered by Google App Engine
This is Rietveld 408576698