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

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

Issue 1318143005: Add mutableComponent() interface to InterpolationValue (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef PrimitiveInterpolation_h 5 #ifndef PrimitiveInterpolation_h
6 #define PrimitiveInterpolation_h 6 #define PrimitiveInterpolation_h
7 7
8 #include "core/animation/InterpolationValue.h" 8 #include "core/animation/InterpolationValue.h"
9 #include "platform/animation/AnimationUtilities.h" 9 #include "platform/animation/AnimationUtilities.h"
10 #include "platform/heap/Handle.h" 10 #include "platform/heap/Handle.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 , m_start(start) 52 , m_start(start)
53 , m_end(end) 53 , m_end(end)
54 , m_nonInterpolableValue(nonInterpolableValue) 54 , m_nonInterpolableValue(nonInterpolableValue)
55 { } 55 { }
56 56
57 void interpolateValue(double fraction, OwnPtr<InterpolationValue>& result) c onst final 57 void interpolateValue(double fraction, OwnPtr<InterpolationValue>& result) c onst final
58 { 58 {
59 ASSERT(result); 59 ASSERT(result);
60 ASSERT(&result->type() == &m_type); 60 ASSERT(&result->type() == &m_type);
61 ASSERT(result->nonInterpolableValue() == m_nonInterpolableValue.get()); 61 ASSERT(result->nonInterpolableValue() == m_nonInterpolableValue.get());
62 m_start->interpolate(*m_end, fraction, result->interpolableValue()); 62 m_start->interpolate(*m_end, fraction, *result->mutableComponent().inter polableValue);
63 } 63 }
64 64
65 double interpolateUnderlyingFraction(double start, double end, double fracti on) const final { return blend(start, end, fraction); } 65 double interpolateUnderlyingFraction(double start, double end, double fracti on) const final { return blend(start, end, fraction); }
66 66
67 const InterpolationType& m_type; 67 const InterpolationType& m_type;
68 OwnPtr<InterpolableValue> m_start; 68 OwnPtr<InterpolableValue> m_start;
69 OwnPtr<InterpolableValue> m_end; 69 OwnPtr<InterpolableValue> m_end;
70 RefPtrWillBePersistent<NonInterpolableValue> m_nonInterpolableValue; 70 RefPtrWillBePersistent<NonInterpolableValue> m_nonInterpolableValue;
71 }; 71 };
72 72
(...skipping 29 matching lines...) Expand all
102 bool isFlip() const final { return true; } 102 bool isFlip() const final { return true; }
103 103
104 OwnPtr<InterpolationValue> m_start; 104 OwnPtr<InterpolationValue> m_start;
105 OwnPtr<InterpolationValue> m_end; 105 OwnPtr<InterpolationValue> m_end;
106 mutable double m_lastFraction; 106 mutable double m_lastFraction;
107 }; 107 };
108 108
109 } // namespace blink 109 } // namespace blink
110 110
111 #endif // PrimitiveInterpolation_h 111 #endif // PrimitiveInterpolation_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698