blob: 9c700c549faa60de4c3189c1736979257af2bdce [file] [log] [blame]
[email protected]a67935f2012-02-10 14:26:241// Copyright (c) 2012 The Chromium Authors. All rights reserved.
[email protected]b4db9372011-10-24 14:44:192// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
[email protected]116302fc2012-05-05 21:45:415#ifndef UI_COMPOSITOR_LAYER_ANIMATION_DELEGATE_H_
6#define UI_COMPOSITOR_LAYER_ANIMATION_DELEGATE_H_
[email protected]b4db9372011-10-24 14:44:197
[email protected]e81480f1f2012-10-11 23:06:458#include "third_party/skia/include/core/SkColor.h"
[email protected]116302fc2012-05-05 21:45:419#include "ui/compositor/compositor_export.h"
Francois Doray91e63fb72017-11-08 14:21:5210#include "ui/compositor/property_change_reason.h"
tfarina3b0452d2014-12-31 15:20:0911#include "ui/gfx/geometry/rect.h"
[email protected]b4db9372011-10-24 14:44:1912#include "ui/gfx/transform.h"
[email protected]b4db9372011-10-24 14:44:1913
loyso1fbd9f92015-12-17 07:43:1314namespace cc {
15class Layer;
16}
17
[email protected]b4db9372011-10-24 14:44:1918namespace ui {
19
wutao52217d12017-08-18 02:40:3120class Layer;
[email protected]9034a282014-06-05 03:11:4721class LayerAnimatorCollection;
loyso1fe980f2016-01-18 23:58:1522class LayerThreadedAnimationDelegate;
[email protected]9034a282014-06-05 03:11:4723
[email protected]fe7074c62011-10-28 15:22:5424// Layer animations interact with the layers using this interface.
[email protected]b4db9372011-10-24 14:44:1925class COMPOSITOR_EXPORT LayerAnimationDelegate {
26 public:
Francois Doray91e63fb72017-11-08 14:21:5227 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 Keshavb8ac9e572019-07-03 00:26:5541 virtual void SetClipRectFromAnimation(const gfx::Rect& clip_rect,
42 PropertyChangeReason reason) = 0;
[email protected]b4db9372011-10-24 14:44:1943 virtual void ScheduleDrawForAnimation() = 0;
44 virtual const gfx::Rect& GetBoundsForAnimation() const = 0;
[email protected]712f4b642013-03-14 07:09:1545 virtual gfx::Transform GetTransformForAnimation() const = 0;
[email protected]b4db9372011-10-24 14:44:1946 virtual float GetOpacityForAnimation() const = 0;
[email protected]a67935f2012-02-10 14:26:2447 virtual bool GetVisibilityForAnimation() const = 0;
[email protected]815d0c382012-07-21 08:13:4448 virtual float GetBrightnessForAnimation() const = 0;
49 virtual float GetGrayscaleForAnimation() const = 0;
[email protected]e81480f1f2012-10-11 23:06:4550 virtual SkColor GetColorForAnimation() const = 0;
Malay Keshavb8ac9e572019-07-03 00:26:5551 virtual gfx::Rect GetClipRectForAnimation() const = 0;
[email protected]712f4b642013-03-14 07:09:1552 virtual float GetDeviceScaleFactor() const = 0;
wutao52217d12017-08-18 02:40:3153 virtual ui::Layer* GetLayer() = 0;
loyso1fbd9f92015-12-17 07:43:1354 virtual cc::Layer* GetCcLayer() const = 0;
loyso841229002015-12-21 10:03:2455 virtual LayerAnimatorCollection* GetLayerAnimatorCollection() = 0;
loyso1fe980f2016-01-18 23:58:1556 virtual LayerThreadedAnimationDelegate* GetThreadedAnimationDelegate() = 0;
varkha62ba671d2017-01-25 19:09:4657 virtual int GetFrameNumber() const = 0;
58 virtual float GetRefreshRate() const = 0;
loyso841229002015-12-21 10:03:2459
[email protected]b4db9372011-10-24 14:44:1960 protected:
61 virtual ~LayerAnimationDelegate() {}
62};
63
64} // namespace ui
65
[email protected]116302fc2012-05-05 21:45:4166#endif // UI_COMPOSITOR_LAYER_ANIMATION_DELEGATE_H_