| 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/PtrUtil.h" | 12 #include "wtf/PassOwnPtr.h" |
| 13 |
| 13 #include <memory> | 14 #include <memory> |
| 14 | 15 |
| 15 namespace cc { | 16 namespace cc { |
| 16 class Animation; | 17 class Animation; |
| 17 } | 18 } |
| 18 | 19 |
| 19 namespace blink { | 20 namespace blink { |
| 20 | 21 |
| 21 class CompositorAnimationCurve; | 22 class CompositorAnimationCurve; |
| 22 class CompositorFloatAnimationCurve; | 23 class CompositorFloatAnimationCurve; |
| 23 | 24 |
| 24 // A compositor driven animation. | 25 // A compositor driven animation. |
| 25 class PLATFORM_EXPORT CompositorAnimation { | 26 class PLATFORM_EXPORT CompositorAnimation { |
| 26 WTF_MAKE_NONCOPYABLE(CompositorAnimation); | 27 WTF_MAKE_NONCOPYABLE(CompositorAnimation); |
| 27 public: | 28 public: |
| 28 using Direction = cc::Animation::Direction; | 29 using Direction = cc::Animation::Direction; |
| 29 using FillMode = cc::Animation::FillMode; | 30 using FillMode = cc::Animation::FillMode; |
| 30 | 31 |
| 31 static std::unique_ptr<CompositorAnimation> create(const blink::CompositorAn
imationCurve& curve, CompositorTargetProperty::Type target, int groupId, int ani
mationId) | 32 static PassOwnPtr<CompositorAnimation> create(const blink::CompositorAnimati
onCurve& curve, CompositorTargetProperty::Type target, int groupId, int animatio
nId) |
| 32 { | 33 { |
| 33 return wrapUnique(new CompositorAnimation(curve, target, animationId, gr
oupId)); | 34 return adoptPtr(new CompositorAnimation(curve, target, animationId, grou
pId)); |
| 34 } | 35 } |
| 35 | 36 |
| 36 ~CompositorAnimation(); | 37 ~CompositorAnimation(); |
| 37 | 38 |
| 38 // An id must be unique. | 39 // An id must be unique. |
| 39 int id() const; | 40 int id() const; |
| 40 int group() const; | 41 int group() const; |
| 41 | 42 |
| 42 CompositorTargetProperty::Type targetProperty() const; | 43 CompositorTargetProperty::Type targetProperty() const; |
| 43 | 44 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 60 void setPlaybackRate(double); | 61 void setPlaybackRate(double); |
| 61 | 62 |
| 62 FillMode getFillMode() const; | 63 FillMode getFillMode() const; |
| 63 void setFillMode(FillMode); | 64 void setFillMode(FillMode); |
| 64 | 65 |
| 65 double iterationStart() const; | 66 double iterationStart() const; |
| 66 void setIterationStart(double); | 67 void setIterationStart(double); |
| 67 | 68 |
| 68 std::unique_ptr<cc::Animation> passAnimation(); | 69 std::unique_ptr<cc::Animation> passAnimation(); |
| 69 | 70 |
| 70 std::unique_ptr<CompositorFloatAnimationCurve> floatCurveForTesting() const; | 71 PassOwnPtr<CompositorFloatAnimationCurve> floatCurveForTesting() const; |
| 71 | 72 |
| 72 private: | 73 private: |
| 73 CompositorAnimation(const CompositorAnimationCurve&, CompositorTargetPropert
y::Type, int animationId, int groupId); | 74 CompositorAnimation(const CompositorAnimationCurve&, CompositorTargetPropert
y::Type, int animationId, int groupId); |
| 74 | 75 |
| 75 std::unique_ptr<cc::Animation> m_animation; | 76 std::unique_ptr<cc::Animation> m_animation; |
| 76 }; | 77 }; |
| 77 | 78 |
| 78 } // namespace blink | 79 } // namespace blink |
| 79 | 80 |
| 80 #endif // CompositorAnimation_h | 81 #endif // CompositorAnimation_h |
| OLD | NEW |