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

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

Issue 19367002: Implement DeferredAnimatableValue (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rename class Created 7 years, 5 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 | Annotate | Revision Log
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 10 matching lines...) Expand all
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
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 AnimatableNeutral_h 31 #ifndef DeferredAnimatableValue_h
32 #define AnimatableNeutral_h 32 #define DeferredAnimatableValue_h
33 33
34 #include "core/animation/AnimatableValue.h" 34 #include "core/animation/AnimatableValue.h"
35 35
36 namespace WebCore { 36 namespace WebCore {
37 37
38 class AnimatableNeutral : public AnimatableValue { 38 // Used as a sentinal value to indicate where a snapshot of an element's CSS val ue should go in a KeyframeAnimationEffect::KeyframeVector.
39 class DeferredAnimatableValue : public AnimatableValue {
Steve Block 2013/08/05 08:14:56 For the neutral value you use the name 'Animatable
39 public: 40 public:
40 virtual ~AnimatableNeutral() { } 41 virtual ~DeferredAnimatableValue() { }
41 42
42 virtual PassRefPtr<CSSValue> toCSSValue() const OVERRIDE 43 virtual PassRefPtr<CSSValue> toCSSValue() const OVERRIDE
43 { 44 {
44 ASSERT_NOT_REACHED(); 45 ASSERT_NOT_REACHED();
45 return 0; 46 return 0;
46 } 47 }
47 48
48 virtual bool isNeutral() const OVERRIDE { return true; } 49 virtual bool isDeferredSnapshot() const OVERRIDE { return true; }
49 50
50 protected: 51 protected:
51 static PassRefPtr<AnimatableNeutral> create() { return adoptRef(new Animatab leNeutral()); } 52 static PassRefPtr<DeferredAnimatableValue> create() { return adoptRef(new De ferredAnimatableValue()); }
52 53
53 virtual PassRefPtr<AnimatableValue> interpolateTo(const AnimatableValue* val ue, double fraction) const OVERRIDE 54 virtual PassRefPtr<AnimatableValue> interpolateTo(const AnimatableValue*, do uble fraction) const OVERRIDE
54 { 55 {
55 ASSERT_NOT_REACHED(); 56 ASSERT_NOT_REACHED();
56 return 0; 57 return 0;
57 } 58 }
58 59
59 virtual PassRefPtr<AnimatableValue> addWith(const AnimatableValue* value) co nst OVERRIDE { return defaultAddWith(this, value); } 60 virtual PassRefPtr<AnimatableValue> addWith(const AnimatableValue*) const OV ERRIDE
61 {
62 ASSERT_NOT_REACHED();
63 return 0;
64 }
60 65
61 private: 66 private:
62 AnimatableNeutral() : AnimatableValue(TypeNeutral) { } 67 DeferredAnimatableValue() : AnimatableValue(TypeDeferred) { }
63 68
64 friend class AnimatableValue; 69 friend class AnimatableValue;
65 }; 70 };
66 71
72
67 } // namespace WebCore 73 } // namespace WebCore
68 74
69 #endif // AnimatableNeutral_h 75 #endif // DeferredAnimatableValue_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698