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

Unified Diff: cc/animation/animation_registrar.cc

Issue 1584743002: CC Animation: Replace AnimiationEventsVector with AnimiationEvents class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 11 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_registrar.h ('k') | cc/animation/layer_animation_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/animation/animation_registrar.cc
diff --git a/cc/animation/animation_registrar.cc b/cc/animation/animation_registrar.cc
index c300026ad9421aa9f8d26d98fc1d0180bcc203e8..e5ecf838296ff51071278de068e241a4b6d0a3ac 100644
--- a/cc/animation/animation_registrar.cc
+++ b/cc/animation/animation_registrar.cc
@@ -8,6 +8,7 @@
#include "base/trace_event/trace_event.h"
#include "base/trace_event/trace_event_argument.h"
+#include "cc/animation/animation_events.h"
#include "cc/animation/layer_animation_controller.h"
namespace cc {
@@ -85,7 +86,7 @@ bool AnimationRegistrar::AnimateLayers(base::TimeTicks monotonic_time) {
}
bool AnimationRegistrar::UpdateAnimationState(bool start_ready_animations,
- AnimationEventsVector* events) {
+ AnimationEvents* events) {
if (!needs_animate_layers())
return false;
@@ -98,10 +99,15 @@ bool AnimationRegistrar::UpdateAnimationState(bool start_ready_animations,
return true;
}
+scoped_ptr<AnimationEvents> AnimationRegistrar::CreateEvents() {
+ return make_scoped_ptr(new AnimationEvents());
+}
+
void AnimationRegistrar::SetAnimationEvents(
- scoped_ptr<AnimationEventsVector> events) {
- for (size_t event_index = 0; event_index < events->size(); ++event_index) {
- int event_layer_id = (*events)[event_index].layer_id;
+ scoped_ptr<AnimationEvents> events) {
+ for (size_t event_index = 0; event_index < events->events_.size();
+ ++event_index) {
+ int event_layer_id = events->events_[event_index].layer_id;
// Use the map of all controllers, not just active ones, since non-active
// controllers may still receive events for impl-only animations.
@@ -109,21 +115,22 @@ void AnimationRegistrar::SetAnimationEvents(
all_animation_controllers_;
auto iter = animation_controllers.find(event_layer_id);
if (iter != animation_controllers.end()) {
- switch ((*events)[event_index].type) {
+ switch (events->events_[event_index].type) {
case AnimationEvent::STARTED:
- (*iter).second->NotifyAnimationStarted((*events)[event_index]);
+ (*iter).second->NotifyAnimationStarted(events->events_[event_index]);
break;
case AnimationEvent::FINISHED:
- (*iter).second->NotifyAnimationFinished((*events)[event_index]);
+ (*iter).second->NotifyAnimationFinished(events->events_[event_index]);
break;
case AnimationEvent::ABORTED:
- (*iter).second->NotifyAnimationAborted((*events)[event_index]);
+ (*iter).second->NotifyAnimationAborted(events->events_[event_index]);
break;
case AnimationEvent::PROPERTY_UPDATE:
- (*iter).second->NotifyAnimationPropertyUpdate((*events)[event_index]);
+ (*iter).second->NotifyAnimationPropertyUpdate(
+ events->events_[event_index]);
break;
}
}
« no previous file with comments | « cc/animation/animation_registrar.h ('k') | cc/animation/layer_animation_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698