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

Unified Diff: cc/trees/element_id.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
« no previous file with comments | « cc/test/animation_timelines_test_common.cc ('k') | cc/trees/element_id.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/element_id.h
diff --git a/cc/trees/element_id.h b/cc/trees/element_id.h
index 8518cf8ce13393c93c8d01faf224f27620d5269c..059cf2b36d7e8bdcaec6e9372004319f894bcacc 100644
--- a/cc/trees/element_id.h
+++ b/cc/trees/element_id.h
@@ -24,6 +24,10 @@ class TracedValue;
namespace cc {
+using ElementIdType = uint64_t;
+
+static const ElementIdType kInvalidElementId = 0;
+
// Element ids are chosen by cc's clients and can be used as a stable identifier
// across updates.
//
@@ -44,9 +48,8 @@ namespace cc {
// the Layer's lifetime because non-default ElementIds are only set during an
// animation's lifetime.
struct CC_EXPORT ElementId {
- ElementId(int primaryId, int secondaryId)
- : primaryId(primaryId), secondaryId(secondaryId) {}
- ElementId() : ElementId(0, 0) {}
+ explicit ElementId(int id) : id_(id) {}
+ ElementId() : ElementId(kInvalidElementId) {}
bool operator==(const ElementId& o) const;
bool operator!=(const ElementId& o) const;
@@ -61,11 +64,10 @@ struct CC_EXPORT ElementId {
// The compositor treats this as an opaque handle and should not know how to
// interpret these bits. Non-blink cc clients typically operate in terms of
// layers and may set this value to match the client's layer id.
- int primaryId;
- int secondaryId;
+ ElementIdType id_;
};
-CC_EXPORT ElementId LayerIdToElementIdForTesting(int layer_id);
+ElementId CC_EXPORT LayerIdToElementIdForTesting(int layer_id);
struct CC_EXPORT ElementIdHash {
size_t operator()(ElementId key) const;
« no previous file with comments | « cc/test/animation_timelines_test_common.cc ('k') | cc/trees/element_id.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698