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

Unified Diff: ui/compositor/layer_animation_element.h

Issue 22861008: Add support for inverse transform animations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed loop condition nit. Created 7 years, 3 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 | « ui/compositor/compositor.gyp ('k') | ui/compositor/layer_animation_element.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/layer_animation_element.h
diff --git a/ui/compositor/layer_animation_element.h b/ui/compositor/layer_animation_element.h
index c5949d35e2120a48ef112996622f6159e00f1bba..b027764da3852d5e32ee477335c43f2bc261f571 100644
--- a/ui/compositor/layer_animation_element.h
+++ b/ui/compositor/layer_animation_element.h
@@ -57,6 +57,7 @@ class COMPOSITOR_EXPORT LayerAnimationElement {
LayerAnimationElement(const AnimatableProperties& properties,
base::TimeDelta duration);
+
virtual ~LayerAnimationElement();
// Creates an element that transitions to the given transform. The caller owns
@@ -65,6 +66,14 @@ class COMPOSITOR_EXPORT LayerAnimationElement {
const gfx::Transform& transform,
base::TimeDelta duration);
+ // Creates an element that counters a transition to the given transform.
+ // This element maintains the invariant uninverted_transition->at(t) *
+ // this->at(t) == base_transform * this->at(t_start) for any t. The caller
+ // owns the return value.
+ static LayerAnimationElement* CreateInverseTransformElement(
+ const gfx::Transform& base_transform,
+ const LayerAnimationElement* uninverted_transition);
+
// Creates an element that transitions to another in a way determined by an
// interpolated transform. The element accepts ownership of the interpolated
// transform. NB: at every step, the interpolated transform clobbers the
@@ -178,6 +187,8 @@ class COMPOSITOR_EXPORT LayerAnimationElement {
int animation_group_id() const { return animation_group_id_; }
void set_animation_group_id(int id) { animation_group_id_ = id; }
+ base::TimeDelta duration() const { return duration_; }
+
// The fraction of the animation that has been completed after the last
// call made to {Progress, ProgressToEnd}.
double last_progressed_fraction() const { return last_progressed_fraction_; }
@@ -190,11 +201,11 @@ class COMPOSITOR_EXPORT LayerAnimationElement {
virtual void OnGetTarget(TargetValue* target) const = 0;
virtual void OnAbort(LayerAnimationDelegate* delegate) = 0;
- base::TimeDelta duration() const { return duration_; }
-
// Actually start the animation, dispatching to another thread if needed.
virtual void RequestEffectiveStart(LayerAnimationDelegate* delegate);
+ LayerAnimationElement(const LayerAnimationElement& element);
+
private:
// For debugging purposes, we sometimes alter the duration we actually use.
// For example, during tests we often set duration = 0, and it is sometimes
@@ -215,7 +226,7 @@ class COMPOSITOR_EXPORT LayerAnimationElement {
double last_progressed_fraction_;
- DISALLOW_COPY_AND_ASSIGN(LayerAnimationElement);
+ DISALLOW_ASSIGN(LayerAnimationElement);
};
} // namespace ui
« no previous file with comments | « ui/compositor/compositor.gyp ('k') | ui/compositor/layer_animation_element.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698