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

Side by Side Diff: third_party/WebKit/Source/core/animation/CSSBasicShapeInterpolationType.cpp

Issue 1885353004: Add ComputedStyle constructor and getter to InterpolationEnvironment (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@_transformInterpolationType
Patch Set: Rebased Created 4 years, 4 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/animation/CSSBorderImageLengthBoxInterpolationType.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #include "core/animation/CSSBasicShapeInterpolationType.h" 5 #include "core/animation/CSSBasicShapeInterpolationType.h"
6 6
7 #include "core/animation/BasicShapeInterpolationFunctions.h" 7 #include "core/animation/BasicShapeInterpolationFunctions.h"
8 #include "core/animation/BasicShapePropertyFunctions.h" 8 #include "core/animation/BasicShapePropertyFunctions.h"
9 #include "core/css/CSSValueList.h" 9 #include "core/css/CSSValueList.h"
10 #include "core/css/resolver/StyleResolverState.h" 10 #include "core/css/resolver/StyleResolverState.h"
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 96
97 PairwiseInterpolationValue CSSBasicShapeInterpolationType::maybeMergeSingles(Int erpolationValue&& start, InterpolationValue&& end) const 97 PairwiseInterpolationValue CSSBasicShapeInterpolationType::maybeMergeSingles(Int erpolationValue&& start, InterpolationValue&& end) const
98 { 98 {
99 if (!BasicShapeInterpolationFunctions::shapesAreCompatible(*start.nonInterpo lableValue, *end.nonInterpolableValue)) 99 if (!BasicShapeInterpolationFunctions::shapesAreCompatible(*start.nonInterpo lableValue, *end.nonInterpolableValue))
100 return nullptr; 100 return nullptr;
101 return PairwiseInterpolationValue(std::move(start.interpolableValue), std::m ove(end.interpolableValue), start.nonInterpolableValue.release()); 101 return PairwiseInterpolationValue(std::move(start.interpolableValue), std::m ove(end.interpolableValue), start.nonInterpolableValue.release());
102 } 102 }
103 103
104 InterpolationValue CSSBasicShapeInterpolationType::maybeConvertUnderlyingValue(c onst InterpolationEnvironment& environment) const 104 InterpolationValue CSSBasicShapeInterpolationType::maybeConvertUnderlyingValue(c onst InterpolationEnvironment& environment) const
105 { 105 {
106 const ComputedStyle& style = *environment.state().style(); 106 const ComputedStyle& style = environment.style();
107 return BasicShapeInterpolationFunctions::maybeConvertBasicShape( 107 return BasicShapeInterpolationFunctions::maybeConvertBasicShape(
108 BasicShapePropertyFunctions::getBasicShape(cssProperty(), style), style. effectiveZoom()); 108 BasicShapePropertyFunctions::getBasicShape(cssProperty(), style), style. effectiveZoom());
109 } 109 }
110 110
111 void CSSBasicShapeInterpolationType::composite(UnderlyingValueOwner& underlyingV alueOwner, double underlyingFraction, const InterpolationValue& value, double in terpolationFraction) const 111 void CSSBasicShapeInterpolationType::composite(UnderlyingValueOwner& underlyingV alueOwner, double underlyingFraction, const InterpolationValue& value, double in terpolationFraction) const
112 { 112 {
113 if (!BasicShapeInterpolationFunctions::shapesAreCompatible(*underlyingValueO wner.value().nonInterpolableValue, *value.nonInterpolableValue)) { 113 if (!BasicShapeInterpolationFunctions::shapesAreCompatible(*underlyingValueO wner.value().nonInterpolableValue, *value.nonInterpolableValue)) {
114 underlyingValueOwner.set(*this, value); 114 underlyingValueOwner.set(*this, value);
115 return; 115 return;
116 } 116 }
117 117
118 underlyingValueOwner.mutableValue().interpolableValue->scaleAndAdd(underlyin gFraction, *value.interpolableValue); 118 underlyingValueOwner.mutableValue().interpolableValue->scaleAndAdd(underlyin gFraction, *value.interpolableValue);
119 } 119 }
120 120
121 void CSSBasicShapeInterpolationType::apply(const InterpolableValue& interpolable Value, const NonInterpolableValue* nonInterpolableValue, InterpolationEnvironmen t& environment) const 121 void CSSBasicShapeInterpolationType::apply(const InterpolableValue& interpolable Value, const NonInterpolableValue* nonInterpolableValue, InterpolationEnvironmen t& environment) const
122 { 122 {
123 BasicShapePropertyFunctions::setBasicShape(cssProperty(), *environment.state ().style(), 123 BasicShapePropertyFunctions::setBasicShape(cssProperty(), environment.style( ),
124 BasicShapeInterpolationFunctions::createBasicShape(interpolableValue, *n onInterpolableValue, environment.state().cssToLengthConversionData())); 124 BasicShapeInterpolationFunctions::createBasicShape(interpolableValue, *n onInterpolableValue, environment.state().cssToLengthConversionData()));
125 } 125 }
126 126
127 } // namespace blink 127 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/animation/CSSBorderImageLengthBoxInterpolationType.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698