Commit 61cae6f1 authored by Majid Valipour's avatar Majid Valipour Committed by Commit Bot

Improve event generation logic in AnimationTicker

Dispatch events for all event types for impl only animations. Previously this was
only done for start|finish but we are doing it for abort|takeover too. There is
no good reason not to do so and doing so is simple and consistent.


Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.android:android_optional_gpu_tests_rel
Change-Id: I50ccd1fda663dd3e922f5ac97b0a3b6705fb352f
Reviewed-on: https://chromium-review.googlesource.com/911612Reviewed-by: default avatarRobert Flack <flackr@chromium.org>
Reviewed-by: default avatarSteve Kobes <skobes@chromium.org>
Commit-Queue: Majid Valipour <majidvp@chromium.org>
Cr-Commit-Position: refs/heads/master@{#536909}
parent 26c242a7
...@@ -1052,26 +1052,26 @@ void AnimationTicker::GenerateEvent(AnimationEvents* events, ...@@ -1052,26 +1052,26 @@ void AnimationTicker::GenerateEvent(AnimationEvents* events,
AnimationEvent event(type, element_id_, animation.group(), AnimationEvent event(type, element_id_, animation.group(),
animation.target_property_id(), monotonic_time); animation.target_property_id(), monotonic_time);
event.is_impl_only = animation.is_impl_only(); event.is_impl_only = animation.is_impl_only();
if (event.is_impl_only) { if (!event.is_impl_only) {
// Notify delegate directly, do not record the event.
switch (type) {
case AnimationEvent::FINISHED:
animation_player_->NotifyAnimationFinished(event);
break;
case AnimationEvent::STARTED:
animation_player_->NotifyAnimationStarted(event);
break;
case AnimationEvent::ABORTED:
// TODO(majidvp): We do nothing here to match the old logic. Though
// there does not seem to be a rationale behind treating ABORT
// exceptionally (most likely just an oversight). We should instead
// notify the player in this case and all other event types as well.
break;
default:
NOTREACHED();
}
} else {
events->events_.push_back(event); events->events_.push_back(event);
return;
}
// For impl only animations notify delegate directly, do not record the event.
switch (type) {
case AnimationEvent::FINISHED:
animation_player_->NotifyAnimationFinished(event);
break;
case AnimationEvent::STARTED:
animation_player_->NotifyAnimationStarted(event);
break;
case AnimationEvent::ABORTED:
animation_player_->NotifyAnimationAborted(event);
break;
case AnimationEvent::TAKEOVER:
// We never expect to receive a TAKEOVER notification on impl only
// animations.
NOTREACHED();
break;
} }
} }
...@@ -1095,5 +1095,4 @@ void AnimationTicker::GenerateTakeoverEventForScrollAnimation( ...@@ -1095,5 +1095,4 @@ void AnimationTicker::GenerateTakeoverEventForScrollAnimation(
// Notify main thread. // Notify main thread.
events->events_.push_back(takeover_event); events->events_.push_back(takeover_event);
} }
} // namespace cc } // namespace cc
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment