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

Unified Diff: cc/animation/element_animations.cc

Issue 2971503002: Transform animations should not collapse by default when interpolating (Closed)
Patch Set: . Created 3 years, 5 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/element_animations.h ('k') | cc/animation/keyframed_animation_curve.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/animation/element_animations.cc
diff --git a/cc/animation/element_animations.cc b/cc/animation/element_animations.cc
index e43ac4fc838e0cca53c696fd02def912de416e14..322530ba7ab8797a1427894d310878595436b947 100644
--- a/cc/animation/element_animations.cc
+++ b/cc/animation/element_animations.cc
@@ -15,6 +15,7 @@
#include "cc/animation/animation_host.h"
#include "cc/animation/animation_player.h"
#include "cc/animation/keyframed_animation_curve.h"
+#include "cc/animation/transform_operations.h"
#include "cc/base/filter_operations.h"
#include "cc/trees/mutator_host_client.h"
#include "ui/gfx/geometry/box_f.h"
@@ -200,14 +201,18 @@ void ElementAnimations::NotifyAnimationPropertyUpdate(
bool notify_active_elements = true;
bool notify_pending_elements = true;
switch (event.target_property) {
- case TargetProperty::OPACITY:
+ case TargetProperty::OPACITY: {
NotifyClientOpacityAnimated(event.opacity, notify_active_elements,
notify_pending_elements);
break;
- case TargetProperty::TRANSFORM:
- NotifyClientTransformAnimated(event.transform, notify_active_elements,
- notify_pending_elements);
+ }
+ case TargetProperty::TRANSFORM: {
+ TransformOperations operations;
+ operations.AppendMatrix(event.transform);
+ NotifyClientTransformOperationsAnimated(
+ operations, notify_active_elements, notify_pending_elements);
break;
+ }
default:
NOTREACHED();
}
@@ -324,10 +329,11 @@ void ElementAnimations::NotifyClientOpacityAnimated(
OnOpacityAnimated(ElementListType::PENDING, opacity);
}
-void ElementAnimations::NotifyClientTransformAnimated(
- const gfx::Transform& transform,
+void ElementAnimations::NotifyClientTransformOperationsAnimated(
+ const TransformOperations& operations,
bool notify_active_elements,
bool notify_pending_elements) {
+ gfx::Transform transform = operations.Apply();
if (notify_active_elements && has_element_in_active_list())
OnTransformAnimated(ElementListType::ACTIVE, transform);
if (notify_pending_elements && has_element_in_pending_list())
« no previous file with comments | « cc/animation/element_animations.h ('k') | cc/animation/keyframed_animation_curve.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698