Chromium Code Reviews| 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..1c1e858a4a6bbf6d20d14da3c0f89ef8f1e050c6 100644 |
| --- a/third_party/WebKit/Source/platform/graphics/CompositorElementId.h |
| +++ b/third_party/WebKit/Source/platform/graphics/CompositorElementId.h |
| @@ -13,20 +13,20 @@ |
| namespace blink { |
| -enum class CompositorSubElementId { |
| +enum class CompositorElementIdNamespace { |
| kPrimary, |
| kScroll, |
| kViewport, |
| kLinkHighlight, |
| + kScrollbar, |
| // A sentinel to indicate how many enum values there are. |
| - kNumSubElementTypes |
| + kMaxRepresentableNamespaceId = 8 |
|
wkorman
2017/05/12 22:29:39
Could define kNamespaceBits = 3 above/somewhere, a
chrishtr
2017/05/12 23:44:16
Great idea! Done. Xianzhu++, it was his idea from
|
| }; |
| using CompositorElementId = cc::ElementId; |
| -using DOMNodeId = uint64_t; |
| CompositorElementId PLATFORM_EXPORT |
| - CreateCompositorElementId(DOMNodeId, CompositorSubElementId); |
| +CreateCompositorElementId(uint64_t id, CompositorElementIdNamespace); |
|
wkorman
2017/05/12 22:29:39
Is conflict between scrollbar id and dom node id n
chrishtr
2017/05/12 23:44:16
Done.
|
| // Note cc::ElementId has a hash function already implemented via |
| // ElementIdHash::operator(). However for consistency's sake we choose to use |
| @@ -42,9 +42,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> { |