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

Unified Diff: cc/animation/animation_host.cc

Issue 1973083002: Use element id's for animations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 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/animation/animation_host.h ('k') | cc/animation/animation_host_perftest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/animation/animation_host.cc
diff --git a/cc/animation/animation_host.cc b/cc/animation/animation_host.cc
index 7e10d83f9d511effdb8263564425b8cd2efca636..148a0afe0ae62c63d2178675e1bdd4b8568c06bc 100644
--- a/cc/animation/animation_host.cc
+++ b/cc/animation/animation_host.cc
@@ -235,7 +235,8 @@ void AnimationHost::PushPropertiesToImplThread(AnimationHost* host_impl) {
scoped_refptr<ElementAnimations>
AnimationHost::GetElementAnimationsForElementId(ElementId element_id) const {
- DCHECK(element_id);
+ if (!element_id)
+ return nullptr;
auto iter = element_to_animations_map_.find(element_id);
return iter == element_to_animations_map_.end() ? nullptr : iter->second;
}
@@ -301,14 +302,14 @@ void AnimationHost::SetAnimationEvents(
std::unique_ptr<AnimationEvents> events) {
for (size_t event_index = 0; event_index < events->events_.size();
++event_index) {
- int event_layer_id = events->events_[event_index].element_id;
+ ElementId element_id = events->events_[event_index].element_id;
// Use the map of all ElementAnimations, not just active ones, since
// non-active ElementAnimations may still receive events for impl-only
// animations.
const ElementToAnimationsMap& all_element_animations =
element_to_animations_map_;
- auto iter = all_element_animations.find(event_layer_id);
+ auto iter = all_element_animations.find(element_id);
if (iter != all_element_animations.end()) {
switch (events->events_[event_index].type) {
case AnimationEvent::STARTED:
« no previous file with comments | « cc/animation/animation_host.h ('k') | cc/animation/animation_host_perftest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698