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

Unified Diff: cc/trees/element_id.cc

Issue 2860293002: Change cc::ElementId to be a uint64_t (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: cc/trees/element_id.cc
diff --git a/cc/trees/element_id.cc b/cc/trees/element_id.cc
index 45913303c1019dfa9c36113d6a11fffae12c1bfb..66c13566df4da0ace4530009e5db2c07212260b4 100644
--- a/cc/trees/element_id.cc
+++ b/cc/trees/element_id.cc
@@ -3,17 +3,15 @@
// found in the LICENSE file.
#include "cc/trees/element_id.h"
-
#include <limits>
#include <ostream>
-
#include "base/trace_event/trace_event_argument.h"
#include "base/values.h"
namespace cc {
bool ElementId::operator==(const ElementId& o) const {
- return primaryId == o.primaryId && secondaryId == o.secondaryId;
+ return id == o.id;
}
bool ElementId::operator!=(const ElementId& o) const {
@@ -21,36 +19,15 @@ bool ElementId::operator!=(const ElementId& o) const {
}
bool ElementId::operator<(const ElementId& o) const {
- return std::tie(primaryId, secondaryId) <
- std::tie(o.primaryId, o.secondaryId);
+ return id < o.id;
}
ElementId::operator bool() const {
- return !!primaryId;
-}
-
-ElementId LayerIdToElementIdForTesting(int layer_id) {
- return ElementId(std::numeric_limits<int>::max() - layer_id, 0);
-}
-
-void ElementId::AddToTracedValue(base::trace_event::TracedValue* res) const {
- res->SetInteger("primaryId", primaryId);
- res->SetInteger("secondaryId", secondaryId);
-}
-
-std::unique_ptr<base::Value> ElementId::AsValue() const {
- std::unique_ptr<base::DictionaryValue> res(new base::DictionaryValue());
- res->SetInteger("primaryId", primaryId);
- res->SetInteger("secondaryId", secondaryId);
- return std::move(res);
-}
-
-size_t ElementIdHash::operator()(ElementId key) const {
- return base::HashInts(key.primaryId, key.secondaryId);
+ return !!id;
}
-std::ostream& operator<<(std::ostream& out, const ElementId& id) {
- return out << "(" << id.primaryId << ", " << id.secondaryId << ")";
+std::ostream& operator<<(std::ostream& out, const ElementId& element_id) {
+ return out << "(" << element_id.id << ")";
}
} // namespace cc

Powered by Google App Engine
This is Rietveld 408576698