| 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 20 matching lines...) Expand all Loading... |
| 31 #ifndef CompositorAnimations_h | 31 #ifndef CompositorAnimations_h |
| 32 #define CompositorAnimations_h | 32 #define CompositorAnimations_h |
| 33 | 33 |
| 34 #include "core/animation/AnimationEffect.h" | 34 #include "core/animation/AnimationEffect.h" |
| 35 #include "core/animation/Timing.h" | 35 #include "core/animation/Timing.h" |
| 36 #include "platform/animation/TimingFunction.h" | 36 #include "platform/animation/TimingFunction.h" |
| 37 #include "wtf/Vector.h" | 37 #include "wtf/Vector.h" |
| 38 | 38 |
| 39 namespace blink { | 39 namespace blink { |
| 40 | 40 |
| 41 class AnimationPlayer; |
| 41 class Element; | 42 class Element; |
| 42 class FloatBox; | 43 class FloatBox; |
| 43 | 44 |
| 44 class CompositorAnimations { | 45 class CompositorAnimations { |
| 45 public: | 46 public: |
| 46 static CompositorAnimations* instance() { return instance(0); } | 47 static CompositorAnimations* instance() { return instance(0); } |
| 47 static void setInstanceForTesting(CompositorAnimations* newInstance) { insta
nce(newInstance); } | 48 static void setInstanceForTesting(CompositorAnimations* newInstance) { insta
nce(newInstance); } |
| 48 | 49 |
| 49 virtual bool isCandidateForAnimationOnCompositor(const Timing&, const Animat
ionEffect&, double playerPlaybackRate); | 50 virtual bool isCandidateForAnimationOnCompositor(const Timing&, const Elemen
t&, const AnimationPlayer*, const AnimationEffect&, double playerPlaybackRate); |
| 51 virtual void cancelIncompatibleAnimationsOnCompositor(const Element&, const
AnimationPlayer&, const AnimationEffect&); |
| 50 virtual bool canStartAnimationOnCompositor(const Element&); | 52 virtual bool canStartAnimationOnCompositor(const Element&); |
| 51 // FIXME: This should return void. We should know ahead of time whether thes
e animations can be started. | 53 // FIXME: This should return void. We should know ahead of time whether thes
e animations can be started. |
| 52 virtual bool startAnimationOnCompositor(const Element&, int group, double st
artTime, double timeOffset, const Timing&, const AnimationEffect&, Vector<int>&
startedAnimationIds, double playerPlaybackRate); | 54 virtual bool startAnimationOnCompositor(const Element&, int group, double st
artTime, double timeOffset, const Timing&, const AnimationPlayer*, const Animati
onEffect&, Vector<int>& startedAnimationIds, double playerPlaybackRate); |
| 53 virtual void cancelAnimationOnCompositor(const Element&, int id); | 55 virtual void cancelAnimationOnCompositor(const Element&, int id); |
| 54 virtual void pauseAnimationForTestingOnCompositor(const Element&, int id, do
uble pauseTime); | 56 virtual void pauseAnimationForTestingOnCompositor(const Element&, int id, do
uble pauseTime); |
| 55 | 57 |
| 56 virtual bool getAnimatedBoundingBox(FloatBox&, const AnimationEffect&, doubl
e minValue, double maxValue) const; | 58 virtual bool getAnimatedBoundingBox(FloatBox&, const AnimationEffect&, doubl
e minValue, double maxValue) const; |
| 57 protected: | 59 protected: |
| 58 CompositorAnimations() { } | 60 CompositorAnimations() { } |
| 59 | 61 |
| 60 private: | 62 private: |
| 61 static CompositorAnimations* instance(CompositorAnimations* newInstance) | 63 static CompositorAnimations* instance(CompositorAnimations* newInstance) |
| 62 { | 64 { |
| 63 static CompositorAnimations* instance = new CompositorAnimations(); | 65 static CompositorAnimations* instance = new CompositorAnimations(); |
| 64 if (newInstance) { | 66 if (newInstance) { |
| 65 instance = newInstance; | 67 instance = newInstance; |
| 66 } | 68 } |
| 67 return instance; | 69 return instance; |
| 68 } | 70 } |
| 69 }; | 71 }; |
| 70 | 72 |
| 71 } // namespace blink | 73 } // namespace blink |
| 72 | 74 |
| 73 #endif | 75 #endif |
| OLD | NEW |