summaryrefslogtreecommitdiffstats
path: root/chromium/third_party/blink/renderer/core/animation/worklet_animation_base.h
blob: bf56943311876a218a3c2dc97f86d56506a0a9d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_ANIMATION_WORKLET_ANIMATION_BASE_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_ANIMATION_WORKLET_ANIMATION_BASE_H_

#include "third_party/blink/renderer/core/core_export.h"
#include "third_party/blink/renderer/platform/bindings/script_wrappable.h"
#include "third_party/blink/renderer/platform/graphics/animation_worklet_mutators_state.h"
#include "third_party/blink/renderer/platform/wtf/forward.h"

namespace blink {

class AnimationTimeline;
class Document;
class KeyframeEffect;

class CORE_EXPORT WorkletAnimationBase : public ScriptWrappable {
 public:
  ~WorkletAnimationBase() override = default;

  // Asks the animation to update its effect inherited time.
  virtual void Update(TimingUpdateReason) = 0;

  // Updates the animation on the compositor side to reflect the main thread
  // state.
  virtual void UpdateCompositingState() = 0;
  virtual void InvalidateCompositingState() = 0;

  virtual Document* GetDocument() const = 0;
  virtual KeyframeEffect* GetEffect() const = 0;
  virtual const WorkletAnimationId& GetWorkletAnimationId() const = 0;
  virtual bool IsActiveAnimation() const = 0;
  virtual void UpdateInputState(AnimationWorkletDispatcherInput*) = 0;
  virtual void SetOutputState(
      const AnimationWorkletOutput::AnimationState&) = 0;
  virtual AnimationTimeline* GetTimeline() const = 0;
};

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_RENDERER_CORE_ANIMATION_WORKLET_ANIMATION_BASE_H_