| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CompositorAnimation_h | 5 #ifndef CompositorAnimation_h |
| 6 #define CompositorAnimation_h | 6 #define CompositorAnimation_h |
| 7 | 7 |
| 8 #include "cc/animation/animation.h" | 8 #include "cc/animation/animation.h" |
| 9 #include "platform/PlatformExport.h" | 9 #include "platform/PlatformExport.h" |
| 10 #include "platform/animation/CompositorTargetProperty.h" | 10 #include "platform/animation/CompositorTargetProperty.h" |
| 11 #include "wtf/Noncopyable.h" | 11 #include "wtf/Noncopyable.h" |
| 12 #include "wtf/PassOwnPtr.h" | 12 #include "wtf/PtrUtil.h" |
| 13 | |
| 14 #include <memory> | 13 #include <memory> |
| 15 | 14 |
| 16 namespace cc { | 15 namespace cc { |
| 17 class Animation; | 16 class Animation; |
| 18 } | 17 } |
| 19 | 18 |
| 20 namespace blink { | 19 namespace blink { |
| 21 | 20 |
| 22 class CompositorAnimationCurve; | 21 class CompositorAnimationCurve; |
| 23 class CompositorFloatAnimationCurve; | 22 class CompositorFloatAnimationCurve; |
| 24 | 23 |
| 25 // A compositor driven animation. | 24 // A compositor driven animation. |
| 26 class PLATFORM_EXPORT CompositorAnimation { | 25 class PLATFORM_EXPORT CompositorAnimation { |
| 27 WTF_MAKE_NONCOPYABLE(CompositorAnimation); | 26 WTF_MAKE_NONCOPYABLE(CompositorAnimation); |
| 28 public: | 27 public: |
| 29 using Direction = cc::Animation::Direction; | 28 using Direction = cc::Animation::Direction; |
| 30 using FillMode = cc::Animation::FillMode; | 29 using FillMode = cc::Animation::FillMode; |
| 31 | 30 |
| 32 static PassOwnPtr<CompositorAnimation> create(const blink::CompositorAnimati
onCurve& curve, CompositorTargetProperty::Type target, int groupId, int animatio
nId) | 31 static std::unique_ptr<CompositorAnimation> create(const blink::CompositorAn
imationCurve& curve, CompositorTargetProperty::Type target, int groupId, int ani
mationId) |
| 33 { | 32 { |
| 34 return adoptPtr(new CompositorAnimation(curve, target, animationId, grou
pId)); | 33 return wrapUnique(new CompositorAnimation(curve, target, animationId, gr
oupId)); |
| 35 } | 34 } |
| 36 | 35 |
| 37 ~CompositorAnimation(); | 36 ~CompositorAnimation(); |
| 38 | 37 |
| 39 // An id must be unique. | 38 // An id must be unique. |
| 40 int id() const; | 39 int id() const; |
| 41 int group() const; | 40 int group() const; |
| 42 | 41 |
| 43 CompositorTargetProperty::Type targetProperty() const; | 42 CompositorTargetProperty::Type targetProperty() const; |
| 44 | 43 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 61 void setPlaybackRate(double); | 60 void setPlaybackRate(double); |
| 62 | 61 |
| 63 FillMode getFillMode() const; | 62 FillMode getFillMode() const; |
| 64 void setFillMode(FillMode); | 63 void setFillMode(FillMode); |
| 65 | 64 |
| 66 double iterationStart() const; | 65 double iterationStart() const; |
| 67 void setIterationStart(double); | 66 void setIterationStart(double); |
| 68 | 67 |
| 69 std::unique_ptr<cc::Animation> passAnimation(); | 68 std::unique_ptr<cc::Animation> passAnimation(); |
| 70 | 69 |
| 71 PassOwnPtr<CompositorFloatAnimationCurve> floatCurveForTesting() const; | 70 std::unique_ptr<CompositorFloatAnimationCurve> floatCurveForTesting() const; |
| 72 | 71 |
| 73 private: | 72 private: |
| 74 CompositorAnimation(const CompositorAnimationCurve&, CompositorTargetPropert
y::Type, int animationId, int groupId); | 73 CompositorAnimation(const CompositorAnimationCurve&, CompositorTargetPropert
y::Type, int animationId, int groupId); |
| 75 | 74 |
| 76 std::unique_ptr<cc::Animation> m_animation; | 75 std::unique_ptr<cc::Animation> m_animation; |
| 77 }; | 76 }; |
| 78 | 77 |
| 79 } // namespace blink | 78 } // namespace blink |
| 80 | 79 |
| 81 #endif // CompositorAnimation_h | 80 #endif // CompositorAnimation_h |
| OLD | NEW |