| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef UI_COMPOSITOR_LAYER_ANIMATION_DELEGATE_H_ | 5 #ifndef UI_COMPOSITOR_LAYER_ANIMATION_DELEGATE_H_ |
| 6 #define UI_COMPOSITOR_LAYER_ANIMATION_DELEGATE_H_ | 6 #define UI_COMPOSITOR_LAYER_ANIMATION_DELEGATE_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "cc/animation/animation.h" | 9 #include "cc/animation/animation.h" |
| 10 #include "third_party/skia/include/core/SkColor.h" | 10 #include "third_party/skia/include/core/SkColor.h" |
| 11 #include "ui/compositor/compositor_export.h" | 11 #include "ui/compositor/compositor_export.h" |
| 12 #include "ui/gfx/rect.h" | 12 #include "ui/gfx/rect.h" |
| 13 #include "ui/gfx/transform.h" | 13 #include "ui/gfx/transform.h" |
| 14 | 14 |
| 15 namespace ui { | 15 namespace ui { |
| 16 | 16 |
| 17 class LayerAnimatorCollection; | |
| 18 | |
| 19 // Layer animations interact with the layers using this interface. | 17 // Layer animations interact with the layers using this interface. |
| 20 class COMPOSITOR_EXPORT LayerAnimationDelegate { | 18 class COMPOSITOR_EXPORT LayerAnimationDelegate { |
| 21 public: | 19 public: |
| 22 virtual void SetBoundsFromAnimation(const gfx::Rect& bounds) = 0; | 20 virtual void SetBoundsFromAnimation(const gfx::Rect& bounds) = 0; |
| 23 virtual void SetTransformFromAnimation(const gfx::Transform& transform) = 0; | 21 virtual void SetTransformFromAnimation(const gfx::Transform& transform) = 0; |
| 24 virtual void SetOpacityFromAnimation(float opacity) = 0; | 22 virtual void SetOpacityFromAnimation(float opacity) = 0; |
| 25 virtual void SetVisibilityFromAnimation(bool visibility) = 0; | 23 virtual void SetVisibilityFromAnimation(bool visibility) = 0; |
| 26 virtual void SetBrightnessFromAnimation(float brightness) = 0; | 24 virtual void SetBrightnessFromAnimation(float brightness) = 0; |
| 27 virtual void SetGrayscaleFromAnimation(float grayscale) = 0; | 25 virtual void SetGrayscaleFromAnimation(float grayscale) = 0; |
| 28 virtual void SetColorFromAnimation(SkColor color) = 0; | 26 virtual void SetColorFromAnimation(SkColor color) = 0; |
| 29 virtual void ScheduleDrawForAnimation() = 0; | 27 virtual void ScheduleDrawForAnimation() = 0; |
| 30 virtual const gfx::Rect& GetBoundsForAnimation() const = 0; | 28 virtual const gfx::Rect& GetBoundsForAnimation() const = 0; |
| 31 virtual gfx::Transform GetTransformForAnimation() const = 0; | 29 virtual gfx::Transform GetTransformForAnimation() const = 0; |
| 32 virtual float GetOpacityForAnimation() const = 0; | 30 virtual float GetOpacityForAnimation() const = 0; |
| 33 virtual bool GetVisibilityForAnimation() const = 0; | 31 virtual bool GetVisibilityForAnimation() const = 0; |
| 34 virtual float GetBrightnessForAnimation() const = 0; | 32 virtual float GetBrightnessForAnimation() const = 0; |
| 35 virtual float GetGrayscaleForAnimation() const = 0; | 33 virtual float GetGrayscaleForAnimation() const = 0; |
| 36 virtual SkColor GetColorForAnimation() const = 0; | 34 virtual SkColor GetColorForAnimation() const = 0; |
| 37 virtual float GetDeviceScaleFactor() const = 0; | 35 virtual float GetDeviceScaleFactor() const = 0; |
| 38 virtual void AddThreadedAnimation(scoped_ptr<cc::Animation> animation) = 0; | 36 virtual void AddThreadedAnimation(scoped_ptr<cc::Animation> animation) = 0; |
| 39 virtual void RemoveThreadedAnimation(int animation_id) = 0; | 37 virtual void RemoveThreadedAnimation(int animation_id) = 0; |
| 40 virtual LayerAnimatorCollection* GetLayerAnimatorCollection() = 0; | |
| 41 | 38 |
| 42 protected: | 39 protected: |
| 43 virtual ~LayerAnimationDelegate() {} | 40 virtual ~LayerAnimationDelegate() {} |
| 44 }; | 41 }; |
| 45 | 42 |
| 46 } // namespace ui | 43 } // namespace ui |
| 47 | 44 |
| 48 #endif // UI_COMPOSITOR_LAYER_ANIMATION_DELEGATE_H_ | 45 #endif // UI_COMPOSITOR_LAYER_ANIMATION_DELEGATE_H_ |
| OLD | NEW |