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

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

Issue 51943004: Creating a helper class for reversing timing functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 1 month 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 21 matching lines...) Expand all
32 #define CompositorAnimations_h 32 #define CompositorAnimations_h
33 33
34 #include "core/animation/Timing.h" 34 #include "core/animation/Timing.h"
35 #include "wtf/Vector.h" 35 #include "wtf/Vector.h"
36 36
37 namespace WebCore { 37 namespace WebCore {
38 38
39 class Element; 39 class Element;
40 class AnimationEffect; 40 class AnimationEffect;
41 41
42 // Reverse the timing function so that t=0 becomes t=1, t=1 becomes t=0 and
43 // t=0.5 stays the same.
Steve Block 2013/11/06 06:06:23 This is a little vague. Given an input timing func
mithro-old 2013/11/07 01:02:37 Done.
44 // FIXME: Remove once the Compositor natively understands reversing time.
45 class CompositorAnimationsTimingFunctionReverser {
46 public:
47 static PassRefPtr<TimingFunction> reverse(const LinearTimingFunction* timefu nc);
48 static PassRefPtr<TimingFunction> reverse(const CubicBezierTimingFunction* t imefunc);
49 static PassRefPtr<TimingFunction> reverse(const ChainedTimingFunction* timef unc);
Steve Block 2013/11/06 06:06:23 Do the type-specific reverse methods need to be in
mithro-old 2013/11/07 01:02:37 Done.
50 static PassRefPtr<TimingFunction> reverse(const TimingFunction* timefunc);
51 };
52
42 class CompositorAnimations { 53 class CompositorAnimations {
43 54
44 public: 55 public:
45 static CompositorAnimations* instance() { return instance(0); } 56 static CompositorAnimations* instance() { return instance(0); }
46 static void setInstanceForTesting(CompositorAnimations* newInstance) { insta nce(newInstance); } 57 static void setInstanceForTesting(CompositorAnimations* newInstance) { insta nce(newInstance); }
47 58
48 virtual bool isCandidateForCompositorAnimation(const Timing&, const Animatio nEffect*); 59 virtual bool isCandidateForCompositorAnimation(const Timing&, const Animatio nEffect*);
49 virtual bool canStartCompositorAnimation(const Element*); 60 virtual bool canStartCompositorAnimation(const Element*);
50 virtual void startCompositorAnimation(const Element*, const Timing&, const A nimationEffect*, Vector<int>& startedAnimationIds); 61 virtual void startCompositorAnimation(const Element*, const Timing&, const A nimationEffect*, Vector<int>& startedAnimationIds);
51 virtual void cancelCompositorAnimation(const Element*, int id); 62 virtual void cancelCompositorAnimation(const Element*, int id);
52 63
53 protected: 64 protected:
54 CompositorAnimations() { } 65 CompositorAnimations() { }
55 66
56 private: 67 private:
57 static CompositorAnimations* instance(CompositorAnimations* newInstance = 0) 68 static CompositorAnimations* instance(CompositorAnimations* newInstance = 0)
58 { 69 {
59 static CompositorAnimations* instance = new CompositorAnimations(); 70 static CompositorAnimations* instance = new CompositorAnimations();
60 if (newInstance) { 71 if (newInstance) {
61 instance = newInstance; 72 instance = newInstance;
62 } 73 }
63 return instance; 74 return instance;
64 } 75 }
65 }; 76 };
66 77
67 } // namespace WebCore 78 } // namespace WebCore
68 79
69 #endif 80 #endif
OLDNEW
« no previous file with comments | « no previous file | Source/core/animation/CompositorAnimations.cpp » ('j') | Source/core/animation/CompositorAnimations.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698