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

Unified Diff: cc/animation/animation_host.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/animation/animation_host.cc
diff --git a/cc/animation/animation_host.cc b/cc/animation/animation_host.cc
index 80dfae1670ca3cf9ee0622b6e01b73898ef42171..8c293db8694797628e3e01e05817195bae3c434a 100644
--- a/cc/animation/animation_host.cc
+++ b/cc/animation/animation_host.cc
@@ -129,7 +129,7 @@ void AnimationHost::RegisterPlayerForElement(ElementId element_id,
if (!element_animations) {
element_animations = ElementAnimations::Create();
element_animations->SetElementId(element_id);
- element_to_animations_map_[element_animations->element_id()] =
+ element_to_animations_map_[element_animations->element_id().id] =
element_animations;
}
@@ -153,7 +153,7 @@ void AnimationHost::UnregisterPlayerForElement(ElementId element_id,
if (element_animations->IsEmpty()) {
element_animations->ClearAffectedElementTypes();
- element_to_animations_map_.erase(element_animations->element_id());
+ element_to_animations_map_.erase(element_animations->element_id().id);
element_animations->SetAnimationHost(nullptr);
}
@@ -240,8 +240,10 @@ void AnimationHost::PushPropertiesToImplThread(AnimationHost* host_impl) {
for (auto& kv : element_to_animations_map_) {
const auto& element_animations = kv.second;
if (element_animations->needs_push_properties()) {
+ ElementId element_id;
+ element_id.id = kv.first;
auto element_animations_impl =
- host_impl->GetElementAnimationsForElementId(kv.first);
+ host_impl->GetElementAnimationsForElementId(element_id);
if (element_animations_impl)
element_animations->PushPropertiesTo(
std::move(element_animations_impl));
@@ -257,7 +259,7 @@ scoped_refptr<ElementAnimations>
AnimationHost::GetElementAnimationsForElementId(ElementId element_id) const {
if (!element_id)
return nullptr;
- auto iter = element_to_animations_map_.find(element_id);
+ auto iter = element_to_animations_map_.find(element_id.id);
return iter == element_to_animations_map_.end() ? nullptr : iter->second;
}
@@ -330,7 +332,7 @@ void AnimationHost::SetAnimationEvents(
// non-ticking Players may still receive events for impl-only animations.
const ElementToAnimationsMap& all_element_animations =
element_to_animations_map_;
- auto iter = all_element_animations.find(element_id);
+ auto iter = all_element_animations.find(element_id.id);
if (iter != all_element_animations.end()) {
switch (events->events_[event_index].type) {
case AnimationEvent::STARTED:

Powered by Google App Engine
This is Rietveld 408576698