| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef CompositorAnimations_h | 31 #ifndef CompositorAnimations_h |
| 32 #define CompositorAnimations_h | 32 #define CompositorAnimations_h |
| 33 | 33 |
| 34 #include "core/CoreExport.h" | 34 #include "core/CoreExport.h" |
| 35 #include "core/animation/EffectModel.h" | 35 #include "core/animation/EffectModel.h" |
| 36 #include "core/animation/Timing.h" | 36 #include "core/animation/Timing.h" |
| 37 #include "platform/animation/TimingFunction.h" | 37 #include "platform/animation/TimingFunction.h" |
| 38 #include "wtf/Allocator.h" |
| 38 #include "wtf/Vector.h" | 39 #include "wtf/Vector.h" |
| 39 | 40 |
| 40 namespace blink { | 41 namespace blink { |
| 41 | 42 |
| 42 class Animation; | 43 class Animation; |
| 43 class Element; | 44 class Element; |
| 44 class FloatBox; | 45 class FloatBox; |
| 45 | 46 |
| 46 class CORE_EXPORT CompositorAnimations { | 47 class CORE_EXPORT CompositorAnimations { |
| 48 WTF_MAKE_FAST_ALLOCATED(CompositorAnimations); |
| 49 WTF_MAKE_NONCOPYABLE(CompositorAnimations); |
| 47 public: | 50 public: |
| 48 static CompositorAnimations* instance() { return instance(0); } | 51 static CompositorAnimations* instance() { return instance(0); } |
| 49 static void setInstanceForTesting(CompositorAnimations* newInstance) { insta
nce(newInstance); } | 52 static void setInstanceForTesting(CompositorAnimations* newInstance) { insta
nce(newInstance); } |
| 50 static bool isCompositableProperty(CSSPropertyID); | 53 static bool isCompositableProperty(CSSPropertyID); |
| 51 static const CSSPropertyID compositableProperties[6]; | 54 static const CSSPropertyID compositableProperties[6]; |
| 52 | 55 |
| 53 virtual bool isCandidateForAnimationOnCompositor(const Timing&, const Elemen
t&, const Animation*, const EffectModel&, double animationPlaybackRate); | 56 virtual bool isCandidateForAnimationOnCompositor(const Timing&, const Elemen
t&, const Animation*, const EffectModel&, double animationPlaybackRate); |
| 54 virtual void cancelIncompatibleAnimationsOnCompositor(const Element&, const
Animation&, const EffectModel&); | 57 virtual void cancelIncompatibleAnimationsOnCompositor(const Element&, const
Animation&, const EffectModel&); |
| 55 virtual bool canStartAnimationOnCompositor(const Element&); | 58 virtual bool canStartAnimationOnCompositor(const Element&); |
| 56 // FIXME: This should return void. We should know ahead of time whether thes
e animations can be started. | 59 // FIXME: This should return void. We should know ahead of time whether thes
e animations can be started. |
| 57 virtual bool startAnimationOnCompositor(const Element&, int group, double st
artTime, double timeOffset, const Timing&, const Animation&, const EffectModel&,
Vector<int>& startedAnimationIds, double animationPlaybackRate); | 60 virtual bool startAnimationOnCompositor(const Element&, int group, double st
artTime, double timeOffset, const Timing&, const Animation&, const EffectModel&,
Vector<int>& startedAnimationIds, double animationPlaybackRate); |
| 58 virtual void cancelAnimationOnCompositor(const Element&, const Animation&, i
nt id); | 61 virtual void cancelAnimationOnCompositor(const Element&, const Animation&, i
nt id); |
| 59 virtual void pauseAnimationForTestingOnCompositor(const Element&, const Anim
ation&, int id, double pauseTime); | 62 virtual void pauseAnimationForTestingOnCompositor(const Element&, const Anim
ation&, int id, double pauseTime); |
| 60 | 63 |
| 61 virtual bool canAttachCompositedLayers(const Element&, const Animation&); | 64 virtual bool canAttachCompositedLayers(const Element&, const Animation&); |
| 62 virtual void attachCompositedLayers(const Element&, const Animation&); | 65 virtual void attachCompositedLayers(const Element&, const Animation&); |
| 63 | 66 |
| 64 virtual bool getAnimatedBoundingBox(FloatBox&, const EffectModel&, double mi
nValue, double maxValue) const; | 67 virtual bool getAnimatedBoundingBox(FloatBox&, const EffectModel&, double mi
nValue, double maxValue) const; |
| 65 | 68 |
| 66 protected: | 69 protected: |
| 67 CompositorAnimations(); | 70 CompositorAnimations(); |
| 68 | 71 |
| 69 private: | 72 private: |
| 70 static CompositorAnimations* instance(CompositorAnimations* newInstance); | 73 static CompositorAnimations* instance(CompositorAnimations* newInstance); |
| 71 }; | 74 }; |
| 72 | 75 |
| 73 } // namespace blink | 76 } // namespace blink |
| 74 | 77 |
| 75 #endif | 78 #endif |
| OLD | NEW |