[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 | |
Anton Bikineev | eed0b26b | 2021-05-16 03:16:48 | [diff] [blame] | 8 | #include "third_party/abseil-cpp/absl/types/optional.h" |
[email protected] | e81480f1f | 2012-10-11 23:06:45 | [diff] [blame] | 9 | #include "third_party/skia/include/core/SkColor.h" |
[email protected] | 116302fc | 2012-05-05 21:45:41 | [diff] [blame] | 10 | #include "ui/compositor/compositor_export.h" |
Francois Doray | 91e63fb7 | 2017-11-08 14:21:52 | [diff] [blame] | 11 | #include "ui/compositor/property_change_reason.h" |
Sasha McIntosh | 93a0e96 | 2022-03-31 20:02:41 | [diff] [blame] | 12 | #include "ui/gfx/geometry/linear_gradient.h" |
tfarina | 3b0452d | 2014-12-31 15:20:09 | [diff] [blame] | 13 | #include "ui/gfx/geometry/rect.h" |
Jun Mukai | a343db33b | 2019-07-17 23:25:50 | [diff] [blame] | 14 | #include "ui/gfx/geometry/rounded_corners_f.h" |
Xianzhu Wang | 65ef1ad3 | 2021-10-07 03:12:33 | [diff] [blame] | 15 | #include "ui/gfx/geometry/transform.h" |
[email protected] | b4db937 | 2011-10-24 14:44:19 | [diff] [blame] | 16 | |
loyso | 1fbd9f9 | 2015-12-17 07:43:13 | [diff] [blame] | 17 | namespace cc { |
| 18 | class Layer; |
| 19 | } |
| 20 | |
[email protected] | b4db937 | 2011-10-24 14:44:19 | [diff] [blame] | 21 | namespace ui { |
| 22 | |
wutao | 52217d1 | 2017-08-18 02:40:31 | [diff] [blame] | 23 | class Layer; |
[email protected] | 9034a28 | 2014-06-05 03:11:47 | [diff] [blame] | 24 | class LayerAnimatorCollection; |
loyso | 1fe980f | 2016-01-18 23:58:15 | [diff] [blame] | 25 | class LayerThreadedAnimationDelegate; |
[email protected] | 9034a28 | 2014-06-05 03:11:47 | [diff] [blame] | 26 | |
[email protected] | fe7074c6 | 2011-10-28 15:22:54 | [diff] [blame] | 27 | // Layer animations interact with the layers using this interface. |
[email protected] | b4db937 | 2011-10-24 14:44:19 | [diff] [blame] | 28 | class COMPOSITOR_EXPORT LayerAnimationDelegate { |
| 29 | public: |
Francois Doray | 91e63fb7 | 2017-11-08 14:21:52 | [diff] [blame] | 30 | virtual void SetBoundsFromAnimation(const gfx::Rect& bounds, |
| 31 | PropertyChangeReason reason) = 0; |
| 32 | virtual void SetTransformFromAnimation(const gfx::Transform& transform, |
| 33 | PropertyChangeReason reason) = 0; |
| 34 | virtual void SetOpacityFromAnimation(float opacity, |
| 35 | PropertyChangeReason reason) = 0; |
| 36 | virtual void SetVisibilityFromAnimation(bool visibility, |
| 37 | PropertyChangeReason reason) = 0; |
| 38 | virtual void SetBrightnessFromAnimation(float brightnes, |
| 39 | PropertyChangeReason reasons) = 0; |
| 40 | virtual void SetGrayscaleFromAnimation(float grayscale, |
| 41 | PropertyChangeReason reason) = 0; |
| 42 | virtual void SetColorFromAnimation(SkColor color, |
| 43 | PropertyChangeReason reason) = 0; |
Malay Keshav | b8ac9e57 | 2019-07-03 00:26:55 | [diff] [blame] | 44 | virtual void SetClipRectFromAnimation(const gfx::Rect& clip_rect, |
| 45 | PropertyChangeReason reason) = 0; |
Jun Mukai | a343db33b | 2019-07-17 23:25:50 | [diff] [blame] | 46 | virtual void SetRoundedCornersFromAnimation( |
| 47 | const gfx::RoundedCornersF& rounded_corners, |
| 48 | PropertyChangeReason reason) = 0; |
Sasha McIntosh | 93a0e96 | 2022-03-31 20:02:41 | [diff] [blame] | 49 | virtual void SetGradientMaskFromAnimation( |
| 50 | const gfx::LinearGradient& gradient_mask, |
| 51 | PropertyChangeReason reason) = 0; |
[email protected] | b4db937 | 2011-10-24 14:44:19 | [diff] [blame] | 52 | virtual void ScheduleDrawForAnimation() = 0; |
| 53 | virtual const gfx::Rect& GetBoundsForAnimation() const = 0; |
[email protected] | 712f4b64 | 2013-03-14 07:09:15 | [diff] [blame] | 54 | virtual gfx::Transform GetTransformForAnimation() const = 0; |
[email protected] | b4db937 | 2011-10-24 14:44:19 | [diff] [blame] | 55 | virtual float GetOpacityForAnimation() const = 0; |
[email protected] | a67935f | 2012-02-10 14:26:24 | [diff] [blame] | 56 | virtual bool GetVisibilityForAnimation() const = 0; |
[email protected] | 815d0c38 | 2012-07-21 08:13:44 | [diff] [blame] | 57 | virtual float GetBrightnessForAnimation() const = 0; |
| 58 | virtual float GetGrayscaleForAnimation() const = 0; |
[email protected] | e81480f1f | 2012-10-11 23:06:45 | [diff] [blame] | 59 | virtual SkColor GetColorForAnimation() const = 0; |
Malay Keshav | b8ac9e57 | 2019-07-03 00:26:55 | [diff] [
|