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

Unified Diff: ui/gfx/compositor/layer_animation_manager.h

Issue 8362006: Reland r107720 - Enable the new layer animation framework. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge Created 9 years, 2 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/gfx/compositor/layer_animation_element_unittest.cc ('k') | ui/gfx/compositor/layer_animation_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/compositor/layer_animation_manager.h
diff --git a/ui/gfx/compositor/layer_animation_manager.h b/ui/gfx/compositor/layer_animation_manager.h
deleted file mode 100644
index b5b6540c9587ad3555411d9b8ba1cea5675b60fc..0000000000000000000000000000000000000000
--- a/ui/gfx/compositor/layer_animation_manager.h
+++ /dev/null
@@ -1,129 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef UI_GFX_COMPOSITOR_LAYER_ANIMATION_MANAGER_H_
-#define UI_GFX_COMPOSITOR_LAYER_ANIMATION_MANAGER_H_
-#pragma once
-
-#include <map>
-
-#include "base/basictypes.h"
-#include "base/compiler_specific.h"
-#include "base/memory/scoped_ptr.h"
-#include "third_party/skia/include/core/SkScalar.h"
-#include "third_party/skia/include/utils/SkMatrix44.h"
-#include "ui/base/animation/animation_delegate.h"
-#include "ui/gfx/compositor/compositor_export.h"
-
-namespace gfx {
-class Point;
-}
-
-namespace ui {
-
-class Animation;
-class Layer;
-class LayerAnimatorDelegate;
-class Transform;
-
-// LayerAnimationManager manages animating various properties of a Layer.
-class COMPOSITOR_EXPORT LayerAnimationManager : public ui::AnimationDelegate {
- public:
- // Types of properties that can be animated.
- enum AnimationProperty {
- LOCATION,
- OPACITY,
- TRANSFORM,
- };
-
- explicit LayerAnimationManager(Layer* layer);
- virtual ~LayerAnimationManager();
-
- // Sets the animation to use. LayerAnimationManager takes ownership of the
- // animation.
- void SetAnimation(Animation* animation);
-
- ui::Layer* layer() { return layer_; }
-
- // Animates the layer to the specified point. The point is relative to the
- // parent layer.
- void AnimateToPoint(const gfx::Point& target);
-
- // Animates the transform from the current transform to |transform|.
- void AnimateTransform(const Transform& transform);
-
- // Animates the opacity from the current opacity to |target_opacity|.
- void AnimateOpacity(float target_opacity);
-
- // Returns the target value for the specified type. If the specified property
- // is not animating, the current value is returned.
- gfx::Point GetTargetPoint();
- float GetTargetOpacity();
- ui::Transform GetTargetTransform();
-
- // Returns true if animating |property|.
- bool IsAnimating(AnimationProperty property) const;
-
- // Returns true if the animation is running.
- bool IsRunning() const;
-
- // Returns true if the animation has progressed at least once since
- // SetAnimation() was invoked.
- bool got_initial_tick() const { return got_initial_tick_; }
-
- // AnimationDelegate:
- virtual void AnimationProgressed(const Animation* animation) OVERRIDE;
- virtual void AnimationEnded(const Animation* animation) OVERRIDE;
-
- private:
- // Parameters used when animating the location.
- struct LocationParams {
- int start_x;
- int start_y;
- int target_x;
- int target_y;
- };
-
- // Parameters used when animating the transform.
- struct TransformParams {
- SkMScalar start[16];
- SkMScalar target[16];
- };
-
- // Parameters used when animating the opacity.
- struct OpacityParams {
- float start;
- float target;
- };
-
- union Params {
- LocationParams location;
- OpacityParams opacity;
- TransformParams transform;
- };
-
- typedef std::map<AnimationProperty, Params> Elements;
-
- // Stops animating the specified property. This does not set the property
- // being animated to its final value.
- void StopAnimating(AnimationProperty property);
-
- LayerAnimatorDelegate* delegate();
-
- // The layer.
- Layer* layer_;
-
- // Properties being animated.
- Elements elements_;
-
- scoped_ptr<ui::Animation> animation_;
-
- bool got_initial_tick_;
-
- DISALLOW_COPY_AND_ASSIGN(LayerAnimationManager);
-};
-
-} // namespace ui
-
-#endif // UI_GFX_COMPOSITOR_LAYER_ANIMATION_MANAGER_H_
« no previous file with comments | « ui/gfx/compositor/layer_animation_element_unittest.cc ('k') | ui/gfx/compositor/layer_animation_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698