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

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

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: 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..30fd8ab894377b4a25c3475d95425ec374bca67b 100644
--- a/third_party/WebKit/Source/platform/graphics/CompositorElementId.h
+++ b/third_party/WebKit/Source/platform/graphics/CompositorElementId.h
@@ -13,46 +13,24 @@
namespace blink {
+// Do not add more of these without adjusting the bitfield arithmetic in
suzyh_UTC10 (ex-contributor) 2017/05/05 04:27:31 (If we don't remove this enum class) Can we enforc
+// CreateCompositorElementId.
enum class CompositorSubElementId {
pdr. 2017/05/05 03:46:10 Do you know what this is really needed for? I thin
chrishtr 2017/05/05 05:34:52 Thought about this some. Perhaps the reason for th
ajuma 2017/05/05 13:46:42 Yeah, my recollection is that these were added bec
- kPrimary,
- kScroll,
- kViewport,
- kLinkHighlight
+ kPrimary = 0,
+ kScroll = 1,
+ kViewport = 2,
+ kLinkHighlight = 3
};
using CompositorElementId = cc::ElementId;
+static const int kInvalidElementId = 0;
suzyh_UTC10 (ex-contributor) 2017/05/05 04:27:31 Why is this redeclared instead of using the Elemen
chrishtr 2017/05/05 05:34:52 Fixed.
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;
-};
-
-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);
- }
-};
+int PLATFORM_EXPORT DomNodeIdFromCompositorElementId(CompositorElementId);
-using CompositorElementIdSet = HashSet<CompositorElementId,
- CompositorElementIdHash,
- CompositorElementIdHashTraits>;
+using CompositorElementIdSet = HashSet<CompositorElementId>;
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698