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

Side by Side Diff: third_party/WebKit/Source/core/animation/CSSPaintInterpolationType.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
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 #include "core/animation/CSSPaintInterpolationType.h" 5 #include "core/animation/CSSPaintInterpolationType.h"
6 6
7 #include "core/animation/CSSColorInterpolationType.h" 7 #include "core/animation/CSSColorInterpolationType.h"
8 #include "core/animation/PaintPropertyFunctions.h" 8 #include "core/animation/PaintPropertyFunctions.h"
9 #include "core/css/resolver/StyleResolverState.h" 9 #include "core/css/resolver/StyleResolverState.h"
10 #include "wtf/PtrUtil.h" 10 #include "wtf/PtrUtil.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 std::unique_ptr<InterpolableValue> interpolableColor = CSSColorInterpolation Type::maybeCreateInterpolableColor(value); 78 std::unique_ptr<InterpolableValue> interpolableColor = CSSColorInterpolation Type::maybeCreateInterpolableColor(value);
79 if (!interpolableColor) 79 if (!interpolableColor)
80 return nullptr; 80 return nullptr;
81 return InterpolationValue(std::move(interpolableColor)); 81 return InterpolationValue(std::move(interpolableColor));
82 } 82 }
83 83
84 InterpolationValue CSSPaintInterpolationType::maybeConvertUnderlyingValue(const InterpolationEnvironment& environment) const 84 InterpolationValue CSSPaintInterpolationType::maybeConvertUnderlyingValue(const InterpolationEnvironment& environment) const
85 { 85 {
86 // TODO(alancutter): Support capturing and animating with the visited paint color. 86 // TODO(alancutter): Support capturing and animating with the visited paint color.
87 StyleColor underlyingColor; 87 StyleColor underlyingColor;
88 if (!PaintPropertyFunctions::getColor(cssProperty(), *environment.state().st yle(), underlyingColor)) 88 if (!PaintPropertyFunctions::getColor(cssProperty(), environment.style(), un derlyingColor))
89 return nullptr; 89 return nullptr;
90 return InterpolationValue(CSSColorInterpolationType::createInterpolableColor (underlyingColor)); 90 return InterpolationValue(CSSColorInterpolationType::createInterpolableColor (underlyingColor));
91 } 91 }
92 92
93 void CSSPaintInterpolationType::apply(const InterpolableValue& interpolableColor , const NonInterpolableValue*, InterpolationEnvironment& environment) const 93 void CSSPaintInterpolationType::apply(const InterpolableValue& interpolableColor , const NonInterpolableValue*, InterpolationEnvironment& environment) const
94 { 94 {
95 PaintPropertyFunctions::setColor(cssProperty(), *environment.state().style() , CSSColorInterpolationType::resolveInterpolableColor(interpolableColor, environ ment.state())); 95 PaintPropertyFunctions::setColor(cssProperty(), environment.style(), CSSColo rInterpolationType::resolveInterpolableColor(interpolableColor, environment.stat e()));
96 } 96 }
97 97
98 } // namespace blink 98 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698