Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(463)

Side by Side Diff: Source/core/animation/CompositorAnimations.h

Issue 851693007: Prepare for responsive CSS animations. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 28 matching lines...) Expand all
39 namespace blink { 39 namespace blink {
40 40
41 class AnimationPlayer; 41 class AnimationPlayer;
42 class Element; 42 class Element;
43 class FloatBox; 43 class FloatBox;
44 44
45 class CompositorAnimations { 45 class CompositorAnimations {
46 public: 46 public:
47 static CompositorAnimations* instance() { return instance(0); } 47 static CompositorAnimations* instance() { return instance(0); }
48 static void setInstanceForTesting(CompositorAnimations* newInstance) { insta nce(newInstance); } 48 static void setInstanceForTesting(CompositorAnimations* newInstance) { insta nce(newInstance); }
49 static bool isCompositableProperty(CSSPropertyID property) { return property == CSSPropertyOpacity || property == CSSPropertyTransform || property == CSSPro pertyWebkitFilter; }
50 static CSSPropertyID CompositableProperties[3];
49 51
50 virtual bool isCandidateForAnimationOnCompositor(const Timing&, const Elemen t&, const AnimationPlayer*, const AnimationEffect&, double playerPlaybackRate); 52 virtual bool isCandidateForAnimationOnCompositor(const Timing&, const Elemen t&, const AnimationPlayer*, const AnimationEffect&, double playerPlaybackRate);
51 virtual void cancelIncompatibleAnimationsOnCompositor(const Element&, const AnimationPlayer&, const AnimationEffect&); 53 virtual void cancelIncompatibleAnimationsOnCompositor(const Element&, const AnimationPlayer&, const AnimationEffect&);
52 virtual bool canStartAnimationOnCompositor(const Element&); 54 virtual bool canStartAnimationOnCompositor(const Element&);
53 // FIXME: This should return void. We should know ahead of time whether thes e animations can be started. 55 // FIXME: This should return void. We should know ahead of time whether thes e animations can be started.
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); 56 virtual bool startAnimationOnCompositor(const Element&, int group, double st artTime, double timeOffset, const Timing&, const AnimationPlayer*, const Animati onEffect&, Vector<int>& startedAnimationIds, double playerPlaybackRate);
55 virtual void cancelAnimationOnCompositor(const Element&, int id); 57 virtual void cancelAnimationOnCompositor(const Element&, int id);
56 virtual void pauseAnimationForTestingOnCompositor(const Element&, int id, do uble pauseTime); 58 virtual void pauseAnimationForTestingOnCompositor(const Element&, int id, do uble pauseTime);
57 59
58 virtual bool getAnimatedBoundingBox(FloatBox&, const AnimationEffect&, doubl e minValue, double maxValue) const; 60 virtual bool getAnimatedBoundingBox(FloatBox&, const AnimationEffect&, doubl e minValue, double maxValue) const;
59 protected: 61 protected:
60 CompositorAnimations() { } 62 CompositorAnimations() { }
61 63
62 private: 64 private:
63 static CompositorAnimations* instance(CompositorAnimations* newInstance) 65 static CompositorAnimations* instance(CompositorAnimations* newInstance)
64 { 66 {
65 static CompositorAnimations* instance = new CompositorAnimations(); 67 static CompositorAnimations* instance = new CompositorAnimations();
66 if (newInstance) { 68 if (newInstance) {
67 instance = newInstance; 69 instance = newInstance;
68 } 70 }
69 return instance; 71 return instance;
70 } 72 }
71 }; 73 };
72 74
73 } // namespace blink 75 } // namespace blink
74 76
75 #endif 77 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698