[email protected] | a67935f | 2012-02-10 14:26:24 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | b4db937 | 2011-10-24 14:44:19 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. | ||||
4 | |||||
[email protected] | 116302fc | 2012-05-05 21:45:41 | [diff] [blame] | 5 | #ifndef UI_COMPOSITOR_LAYER_ANIMATION_DELEGATE_H_ |
6 | #define UI_COMPOSITOR_LAYER_ANIMATION_DELEGATE_H_ | ||||
[email protected] | b4db937 | 2011-10-24 14:44:19 | [diff] [blame] | 7 | |
[email protected] | e81480f1f | 2012-10-11 23:06:45 | [diff] [blame] | 8 | #include "third_party/skia/include/core/SkColor.h" |
[email protected] | 116302fc | 2012-05-05 21:45:41 | [diff] [blame] | 9 | #include "ui/compositor/compositor_export.h" |
Francois Doray | 91e63fb7 | 2017-11-08 14:21:52 | [diff] [blame] | 10 | #include "ui/compositor/property_change_reason.h" |
tfarina | 3b0452d | 2014-12-31 15:20:09 | [diff] [blame] | 11 | #include "ui/gfx/geometry/rect.h" |
[email protected] | b4db937 | 2011-10-24 14:44:19 | [diff] [blame] | 12 | #include "ui/gfx/transform.h" |
[email protected] | b4db937 | 2011-10-24 14:44:19 | [diff] [blame] | 13 | |
loyso | 1fbd9f9 | 2015-12-17 07:43:13 | [diff] [blame] | 14 | namespace cc { |
15 | class Layer; | ||||
16 | } | ||||
17 | |||||
[email protected] | b4db937 | 2011-10-24 14:44:19 | [diff] [blame] | 18 | namespace ui { |
19 | |||||
wutao | 52217d1 | 2017-08-18 02:40:31 | [diff] [blame] | 20 | class Layer; |
[email protected] | 9034a28 | 2014-06-05 03:11:47 | [diff] [blame] | 21 | class LayerAnimatorCollection; |
loyso | 1fe980f | 2016-01-18 23:58:15 | [diff] [blame] | 22 | class LayerThreadedAnimationDelegate; |
[email protected] | 9034a28 | 2014-06-05 03:11:47 | [diff] [blame] | 23 | |
[email protected] | fe7074c6 | 2011-10-28 15:22:54 | [diff] [blame] | 24 | // Layer animations interact with the layers using this interface. |
[email protected] | b4db937 | 2011-10-24 14:44:19 | [diff] [blame] | 25 | class COMPOSITOR_EXPORT LayerAnimationDelegate { |
26 | public: | ||||
Francois Doray | 91e63fb7 | 2017-11-08 14:21:52 | [diff] [blame] | 27 | virtual void SetBoundsFromAnimation(const gfx::Rect& bounds, |
28 | PropertyChangeReason reason) = 0; | ||||
29 | virtual void SetTransformFromAnimation(const gfx::Transform& transform, | ||||
30 | PropertyChangeReason reason) = 0; | ||||
31 | virtual void SetOpacityFromAnimation(float opacity, | ||||
32 | PropertyChangeReason reason) = 0; | ||||
33 | virtual void SetVisibilityFromAnimation(bool visibility, | ||||
34 | PropertyChangeReason reason) = 0; | ||||
35 | virtual void SetBrightnessFromAnimation(float brightnes, | ||||
36 | PropertyChangeReason reasons) = 0; | ||||
37 | virtual void SetGrayscaleFromAnimation(float grayscale, | ||||
38 | PropertyChangeReason reason) = 0; | ||||
39 | virtual void SetColorFromAnimation(SkColor color, | ||||
40 | PropertyChangeReason reason) = 0; | ||||
Malay Keshav | b8ac9e57 | 2019-07-03 00:26:55 | [diff] [blame^] | 41 | virtual void SetClipRectFromAnimation(const gfx::Rect& clip_rect, |
42 | PropertyChangeReason reason) = 0; | ||||
[email protected] | b4db937 | 2011-10-24 14:44:19 | [diff] [blame] | 43 | virtual void ScheduleDrawForAnimation() = 0; |
44 | virtual const gfx::Rect& GetBoundsForAnimation() const = 0; | ||||
[email protected] | 712f4b64 | 2013-03-14 07:09:15 | [diff] [blame] | 45 | virtual gfx::Transform GetTransformForAnimation() const = 0; |
[email protected] | b4db937 | 2011-10-24 14:44:19 | [diff] [blame] | 46 | virtual float GetOpacityForAnimation() const = 0; |
[email protected] | a67935f | 2012-02-10 14:26:24 | [diff] [blame] | 47 | virtual bool GetVisibilityForAnimation() const = 0; |
[email protected] | 815d0c38 | 2012-07-21 08:13:44 | [diff] [blame] | 48 | virtual float GetBrightnessForAnimation() const = 0; |
49 | virtual float GetGrayscaleForAnimation() const = 0; | ||||
[email protected] | e81480f1f | 2012-10-11 23:06:45 | [diff] [blame] | 50 | virtual SkColor GetColorForAnimation() const = 0; |
Malay Keshav | b8ac9e57 | 2019-07-03 00:26:55 | [diff] [blame^] | 51 | virtual gfx::Rect GetClipRectForAnimation() const = 0; |
[email protected] | 712f4b64 | 2013-03-14 07:09:15 | [diff] [blame] | 52 | virtual float GetDeviceScaleFactor() const = 0; |
wutao | 52217d1 | 2017-08-18 02:40:31 | [diff] [blame] | 53 | virtual ui::Layer* GetLayer() = 0; |
loyso | 1fbd9f9 | 2015-12-17 07:43:13 | [diff] [blame] | 54 | virtual cc::Layer* GetCcLayer() const = 0; |
loyso | 84122900 | 2015-12-21 10:03:24 | [diff] [blame] | 55 | virtual LayerAnimatorCollection* GetLayerAnimatorCollection() = 0; |
loyso | 1fe980f | 2016-01-18 23:58:15 | [diff] [blame] | 56 | virtual LayerThreadedAnimationDelegate* GetThreadedAnimationDelegate() = 0; |
varkha | 62ba671d | 2017-01-25 19:09:46 | [diff] [blame] | 57 | virtual int GetFrameNumber() const = 0; |
58 | virtual float GetRefreshRate() const = 0; | ||||
loyso | 84122900 | 2015-12-21 10:03:24 | [diff] [blame] | 59 | |
[email protected] | b4db937 | 2011-10-24 14:44:19 | [diff] [blame] | 60 | protected: |
61 | virtual ~LayerAnimationDelegate() {} | ||||
62 | }; | ||||
63 | |||||
64 | } // namespace ui | ||||
65 | |||||
[email protected] | 116302fc | 2012-05-05 21:45:41 | [diff] [blame] | 66 | #endif // UI_COMPOSITOR_LAYER_ANIMATION_DELEGATE_H_ |