blob: 1107a59560934144a6807f335a49c51ddaa4ad73 [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
Anton Bikineeveed0b26b2021-05-16 03:16:488#include "third_party/abseil-cpp/absl/types/optional.h"
[email protected]e81480f1f2012-10-11 23:06:459#include "third_party/skia/include/core/SkColor.h"
[email protected]116302fc2012-05-05 21:45:4110#include "ui/compositor/compositor_export.h"
Francois Doray91e63fb72017-11-08 14:21:5211#include "ui/compositor/property_change_reason.h"
Sasha McIntosh93a0e962022-03-31 20:02:4112#include "ui/gfx/geometry/linear_gradient.h"
tfarina3b0452d2014-12-31 15:20:0913#include "ui/gfx/geometry/rect.h"
Jun Mukaia343db33b2019-07-17 23:25:5014#include "ui/gfx/geometry/rounded_corners_f.h"
Xianzhu Wang65ef1ad32021-10-07 03:12:3315#include "ui/gfx/geometry/transform.h"
[email protected]b4db9372011-10-24 14:44:1916
loyso1fbd9f92015-12-17 07:43:1317namespace cc {
18class Layer;
19}
20
[email protected]b4db9372011-10-24 14:44:1921namespace ui {
22
wutao52217d12017-08-18 02:40:3123class Layer;
[email protected]9034a282014-06-05 03:11:4724class LayerAnimatorCollection;
loyso1fe980f2016-01-18 23:58:1525class LayerThreadedAnimationDelegate;
[email protected]9034a282014-06-05 03:11:4726
[email protected]fe7074c62011-10-28 15:22:5427// Layer animations interact with the layers using this interface.
[email protected]b4db9372011-10-24 14:44:1928class COMPOSITOR_EXPORT LayerAnimationDelegate {
29 public:
Francois Doray91e63fb72017-11-08 14:21:5230 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 Keshavb8ac9e572019-07-03 00:26:5544 virtual void SetClipRectFromAnimation(const gfx::Rect& clip_rect,
45 PropertyChangeReason reason) = 0;
Jun Mukaia343db33b2019-07-17 23:25:5046 virtual void SetRoundedCornersFromAnimation(
47 const gfx::RoundedCornersF& rounded_corners,
48 PropertyChangeReason reason) = 0;
Sasha McIntosh93a0e962022-03-31 20:02:4149 virtual void SetGradientMaskFromAnimation(
50 const gfx::LinearGradient& gradient_mask,
51 PropertyChangeReason reason) = 0;
[email protected]b4db9372011-10-24 14:44:1952 virtual void ScheduleDrawForAnimation() = 0;
53 virtual const gfx::Rect& GetBoundsForAnimation() const = 0;
[email protected]712f4b642013-03-14 07:09:1554 virtual gfx::Transform GetTransformForAnimation() const = 0;
[email protected]b4db9372011-10-24 14:44:1955 virtual float GetOpacityForAnimation() const = 0;
[email protected]a67935f2012-02-10 14:26:2456 virtual bool GetVisibilityForAnimation() const = 0;
[email protected]815d0c382012-07-21 08:13:4457 virtual float GetBrightnessForAnimation() const = 0;
58 virtual float GetGrayscaleForAnimation() const = 0;
[email protected]e81480f1f2012-10-11 23:06:4559 virtual SkColor GetColorForAnimation() const = 0;
Malay Keshavb8ac9e572019-07-03 00:26:55