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

Unified Diff: Source/core/css/resolver/FilterOperationResolver.cpp

Issue 64293008: Wrap CSS length conversion arguments in an object (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: don't make it noncopyable ; clang doesn't do the RVO stuffs? 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/css/resolver/FilterOperationResolver.h ('k') | Source/core/css/resolver/FontBuilder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/resolver/FilterOperationResolver.cpp
diff --git a/Source/core/css/resolver/FilterOperationResolver.cpp b/Source/core/css/resolver/FilterOperationResolver.cpp
index 8079f9c41c72166637c782cb0bb86006c82f84a1..58fc56365e060df2eaebfe3e2dfd8d5074321399 100644
--- a/Source/core/css/resolver/FilterOperationResolver.cpp
+++ b/Source/core/css/resolver/FilterOperationResolver.cpp
@@ -50,11 +50,6 @@
namespace WebCore {
-static Length convertToFloatLength(CSSPrimitiveValue* primitiveValue, const RenderStyle* style, const RenderStyle* rootStyle, double multiplier)
-{
- return primitiveValue ? primitiveValue->convertToLength<FixedConversion | PercentConversion>(style, rootStyle, multiplier) : Length(Undefined);
-}
-
static FilterOperation::OperationType filterOperationForType(CSSFilterValue::FilterOperationType type)
{
switch (type) {
@@ -129,7 +124,7 @@ static PassRefPtr<CustomFilterParameter> parseCustomFilterTransformParameter(con
{
RefPtr<CustomFilterTransformParameter> transformParameter = CustomFilterTransformParameter::create(name);
TransformOperations operations;
- TransformBuilder::createTransformOperations(values, state.style(), state.rootElementStyle(), operations);
+ TransformBuilder::createTransformOperations(values, state.cssToLengthConversionData(), operations);
transformParameter->setOperations(operations);
return transformParameter.release();
}
@@ -352,7 +347,7 @@ static PassRefPtr<CustomFilterOperation> createCustomFilterOperation(CSSFilterVa
}
-bool FilterOperationResolver::createFilterOperations(CSSValue* inValue, const RenderStyle* style, const RenderStyle* rootStyle, FilterOperations& outOperations, StyleResolverState& state)
+bool FilterOperationResolver::createFilterOperations(CSSValue* inValue, const CSSToLengthConversionData& unadjustedConversionData, FilterOperations& outOperations, StyleResolverState& state)
{
ASSERT(outOperations.isEmpty());
@@ -368,7 +363,8 @@ bool FilterOperationResolver::createFilterOperations(CSSValue* inValue, const Re
if (!inValue->isValueList())
return false;
- float zoomFactor = (style ? style->effectiveZoom() : 1) * state.elementStyleResources().deviceScaleFactor();
+ float zoomFactor = unadjustedConversionData.zoom() * state.elementStyleResources().deviceScaleFactor();
+ const CSSToLengthConversionData& conversionData = unadjustedConversionData.copyWithAdjustedZoom(zoomFactor);
FilterOperations operations;
for (CSSValueListIterator i = inValue; i.hasMore(); i.advance()) {
CSSValue* currValue = i.value();
@@ -467,7 +463,7 @@ bool FilterOperationResolver::createFilterOperations(CSSValue* inValue, const Re
case CSSFilterValue::BlurFilterOperation: {
Length stdDeviation = Length(0, Fixed);
if (filterValue->length() >= 1)
- stdDeviation = convertToFloatLength(firstValue, style, rootStyle, zoomFactor);
+ stdDeviation = firstValue->convertToLength<FixedConversion | PercentConversion>(conversionData);
if (stdDeviation.isUndefined())
return false;
@@ -483,8 +479,8 @@ bool FilterOperationResolver::createFilterOperations(CSSValue* inValue, const Re
continue;
CSSShadowValue* item = toCSSShadowValue(cssValue);
- IntPoint location(item->x->computeLength<int>(style, rootStyle, zoomFactor), item->y->computeLength<int>(style, rootStyle, zoomFactor));
- int blur = item->blur ? item->blur->computeLength<int>(style, rootStyle, zoomFactor) : 0;
+ IntPoint location(item->x->computeLength<int>(conversionData), item->y->computeLength<int>(conversionData));
+ int blur = item->blur ? item->blur->computeLength<int>(conversionData) : 0;
Color shadowColor;
if (item->color)
shadowColor = state.document().textLinkColors().colorFromPrimitiveValue(item->color.get(), state.style()->visitedDependentColor(CSSPropertyColor));
« no previous file with comments | « Source/core/css/resolver/FilterOperationResolver.h ('k') | Source/core/css/resolver/FontBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698