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

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

Issue 2860293002: Change cc::ElementId to be a uint64_t (Closed)
Patch Set: Merge branch 'master' into secondaryid 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 7a17e46a932681b5b9bdd6454c6d20fa3ae7f409..df3954953bf83844c7cc5b04bddbb4f5a60de2a8 100644
--- a/third_party/WebKit/Source/platform/graphics/CompositorElementId.h
+++ b/third_party/WebKit/Source/platform/graphics/CompositorElementId.h
@@ -17,36 +17,43 @@ enum class CompositorSubElementId {
kPrimary,
kScroll,
kViewport,
- kLinkHighlight
+ kLinkHighlight,
+ // A sentinel to indicate how many enum values there are.
+ kNumSubElementTypes
};
using CompositorElementId = cc::ElementId;
+using DOMNodeId = uint64_t;
CompositorElementId PLATFORM_EXPORT
-CreateCompositorElementId(int dom_node_id, CompositorSubElementId);
+ CreateCompositorElementId(DOMNodeId, 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 unsigned GetHash(const CompositorElementId& key) {
+ return WTF::HashInt(static_cast<cc::ElementIdType>(key.id_));
}
static bool Equal(const CompositorElementId& a,
const CompositorElementId& b) {
- return a.primaryId == b.primaryId && a.secondaryId == b.secondaryId;
+ return a.id_ == b.id_;
}
static const bool safe_to_compare_to_empty_or_deleted = true;
};
+DOMNodeId PLATFORM_EXPORT DomNodeIdFromCompositorElementId(CompositorElementId);
+CompositorSubElementId PLATFORM_EXPORT
+ SubElementIdFromCompositorElementId(CompositorElementId);
+
struct CompositorElementIdHashTraits
: WTF::GenericHashTraits<CompositorElementId> {
- static CompositorElementId EmptyValue() { return CompositorElementId(); }
+ static CompositorElementId EmptyValue() { return CompositorElementId(1); }
static void ConstructDeletedValue(CompositorElementId& slot, bool) {
- slot = CompositorElementId(-1, -1);
+ slot = CompositorElementId();
}
static bool IsDeletedValue(CompositorElementId value) {
- return value == CompositorElementId(-1, -1);
+ return value == CompositorElementId();
}
};
« no previous file with comments | « third_party/WebKit/Source/platform/BUILD.gn ('k') | third_party/WebKit/Source/platform/graphics/CompositorElementId.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698