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

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: Compositor restarts after style change Created 5 years, 11 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 27 matching lines...) Expand all
38 38
39 namespace blink { 39 namespace blink {
40 40
41 class Element; 41 class Element;
42 class FloatBox; 42 class FloatBox;
43 43
44 class CompositorAnimations { 44 class CompositorAnimations {
45 public: 45 public:
46 static CompositorAnimations* instance() { return instance(0); } 46 static CompositorAnimations* instance() { return instance(0); }
47 static void setInstanceForTesting(CompositorAnimations* newInstance) { insta nce(newInstance); } 47 static void setInstanceForTesting(CompositorAnimations* newInstance) { insta nce(newInstance); }
48 static bool isCompositableProperty(CSSPropertyID property) { return property == CSSPropertyOpacity || property == CSSPropertyTransform || property == CSSPro pertyWebkitFilter; }
48 49
49 virtual bool isCandidateForAnimationOnCompositor(const Timing&, const Animat ionEffect&, double playerPlaybackRate); 50 virtual bool isCandidateForAnimationOnCompositor(const Timing&, const Animat ionEffect&, double playerPlaybackRate);
50 virtual bool canStartAnimationOnCompositor(const Element&); 51 virtual bool canStartAnimationOnCompositor(const Element&);
51 // FIXME: This should return void. We should know ahead of time whether thes e animations can be started. 52 // 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); 53 virtual bool startAnimationOnCompositor(const Element&, int group, double st artTime, double timeOffset, const Timing&, const AnimationEffect&, Vector<int>& startedAnimationIds, double playerPlaybackRate);
53 virtual void cancelAnimationOnCompositor(const Element&, int id); 54 virtual void cancelAnimationOnCompositor(const Element&, int id);
54 virtual void pauseAnimationForTestingOnCompositor(const Element&, int id, do uble pauseTime); 55 virtual void pauseAnimationForTestingOnCompositor(const Element&, int id, do uble pauseTime);
55 56
56 virtual bool getAnimatedBoundingBox(FloatBox&, const AnimationEffect&, doubl e minValue, double maxValue) const; 57 virtual bool getAnimatedBoundingBox(FloatBox&, const AnimationEffect&, doubl e minValue, double maxValue) const;
57 protected: 58 protected:
58 CompositorAnimations() { } 59 CompositorAnimations() { }
59 60
60 private: 61 private:
61 static CompositorAnimations* instance(CompositorAnimations* newInstance) 62 static CompositorAnimations* instance(CompositorAnimations* newInstance)
62 { 63 {
63 static CompositorAnimations* instance = new CompositorAnimations(); 64 static CompositorAnimations* instance = new CompositorAnimations();
64 if (newInstance) { 65 if (newInstance) {
65 instance = newInstance; 66 instance = newInstance;
66 } 67 }
67 return instance; 68 return instance;
68 } 69 }
69 }; 70 };
70 71
71 } // namespace blink 72 } // namespace blink
72 73
73 #endif 74 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698