| 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 7a17e46a932681b5b9bdd6454c6d20fa3ae7f409..256978f0a1780b1350fac2414acbf4301d11e24c 100644
|
| --- a/third_party/WebKit/Source/platform/graphics/CompositorElementId.h
|
| +++ b/third_party/WebKit/Source/platform/graphics/CompositorElementId.h
|
| @@ -13,46 +13,27 @@
|
|
|
| namespace blink {
|
|
|
| -enum class CompositorSubElementId {
|
| - kPrimary,
|
| - kScroll,
|
| - kViewport,
|
| - kLinkHighlight
|
| +// Do not add more of these without adjusting the bitfield arithmetic in
|
| +// CreateCompositorElementId.
|
| +enum CompositorSubElementId {
|
| + kPrimary = 0,
|
| + kScroll = 1,
|
| + kViewport = 2,
|
| + kLinkHighlight = 3,
|
| + kNumSubElementTypes = 4
|
| };
|
|
|
| using CompositorElementId = cc::ElementId;
|
| +static const CompositorElementId kInvalidElementId = 0;
|
|
|
| CompositorElementId PLATFORM_EXPORT
|
| -CreateCompositorElementId(int dom_node_id, CompositorSubElementId);
|
| -
|
| -// Note cc::ElementId has a hash function already implemented via
|
| -// ElementIdHash::operator(). However for consistency's sake we choose to use
|
| -// Blink's hash functions with Blink specific data structures.
|
| -struct CompositorElementIdHash {
|
| - static unsigned GetHash(const CompositorElementId& p) {
|
| - return WTF::HashInts(p.primaryId, p.secondaryId);
|
| - }
|
| - static bool Equal(const CompositorElementId& a,
|
| - const CompositorElementId& b) {
|
| - return a.primaryId == b.primaryId && a.secondaryId == b.secondaryId;
|
| - }
|
| - static const bool safe_to_compare_to_empty_or_deleted = true;
|
| -};
|
| +CreateCompositorElementId(uint64_t dom_node_id, CompositorSubElementId);
|
|
|
| -struct CompositorElementIdHashTraits
|
| - : WTF::GenericHashTraits<CompositorElementId> {
|
| - static CompositorElementId EmptyValue() { return CompositorElementId(); }
|
| - static void ConstructDeletedValue(CompositorElementId& slot, bool) {
|
| - slot = CompositorElementId(-1, -1);
|
| - }
|
| - static bool IsDeletedValue(CompositorElementId value) {
|
| - return value == CompositorElementId(-1, -1);
|
| - }
|
| -};
|
| +uint64_t PLATFORM_EXPORT DomNodeIdFromCompositorElementId(CompositorElementId);
|
| +CompositorSubElementId PLATFORM_EXPORT
|
| + SubElementIdFromCompositorElementId(CompositorElementId);
|
|
|
| -using CompositorElementIdSet = HashSet<CompositorElementId,
|
| - CompositorElementIdHash,
|
| - CompositorElementIdHashTraits>;
|
| +using CompositorElementIdSet = HashSet<CompositorElementId>;
|
|
|
| } // namespace blink
|
|
|
|
|