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

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

Issue 1226123008: CSSValue Immediates: Replace CSSPrimitiveValue usage with const references (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@cssvalue_patch_4_attempt_2
Patch Set: Rebase Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/css/resolver/CSSToStyleMap.cpp ('k') | Source/core/css/resolver/StyleBuilder.h » ('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 055ae7befb5aa98a13c4e25f8cfee786e077784d..d2e4570b49c434227c281dc3715a2e25b33df23f 100644
--- a/Source/core/css/resolver/FilterOperationResolver.cpp
+++ b/Source/core/css/resolver/FilterOperationResolver.cpp
@@ -76,7 +76,7 @@ bool FilterOperationResolver::createFilterOperations(CSSValue inValue, const CSS
ASSERT(outOperations.isEmpty());
if (inValue.isPrimitiveValue()) {
- CSSPrimitiveValue primitiveValue = toCSSPrimitiveValue(inValue);
+ const CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(inValue);
if (primitiveValue.getValueID() == CSSValueNone)
return true;
}
@@ -92,7 +92,7 @@ bool FilterOperationResolver::createFilterOperations(CSSValue inValue, const CSS
if (operationType == FilterOperation::REFERENCE) {
if (filterValue.length() != 1)
continue;
- CSSValue argument = filterValue.item(0);
+ const CSSValue& argument = filterValue.item(0);
if (!argument.isSVGDocumentValue())
continue;
@@ -132,8 +132,8 @@ bool FilterOperationResolver::createFilterOperations(CSSValue inValue, const CSS
case CSSValueSaturate: {
double amount = 1;
if (filterValue.length() == 1) {
- amount = toCSSPrimitiveValue(*firstValue).getDoubleValue();
- if (toCSSPrimitiveValue(*firstValue).isPercentage())
+ amount = toCSSPrimitiveValue(firstValue).getDoubleValue();
+ if (toCSSPrimitiveValue(firstValue).isPercentage())
amount /= 100;
}
@@ -143,7 +143,7 @@ bool FilterOperationResolver::createFilterOperations(CSSValue inValue, const CSS
case CSSValueHueRotate: {
double angle = 0;
if (filterValue.length() == 1)
- angle = toCSSPrimitiveValue(*firstValue).computeDegrees();
+ angle = toCSSPrimitiveValue(firstValue).computeDegrees();
operations.operations().append(BasicColorMatrixFilterOperation::create(angle, operationType));
break;
@@ -154,8 +154,8 @@ bool FilterOperationResolver::createFilterOperations(CSSValue inValue, const CSS
case CSSValueOpacity: {
double amount = (filterValue.functionType() == CSSValueBrightness) ? 0 : 1;
if (filterValue.length() == 1) {
- amount = toCSSPrimitiveValue(*firstValue).getDoubleValue();
- if (toCSSPrimitiveValue(*firstValue).isPercentage())
+ amount = toCSSPrimitiveValue(firstValue).getDoubleValue();
+ if (toCSSPrimitiveValue(firstValue).isPercentage())
amount /= 100;
}
@@ -165,7 +165,7 @@ bool FilterOperationResolver::createFilterOperations(CSSValue inValue, const CSS
case CSSValueBlur: {
Length stdDeviation = Length(0, Fixed);
if (filterValue.length() >= 1)
- stdDeviation = toCSSPrimitiveValue(*firstValue).convertToLength(conversionData);
+ stdDeviation = toCSSPrimitiveValue(firstValue).convertToLength(conversionData);
operations.operations().append(BlurFilterOperation::create(stdDeviation));
break;
}
@@ -173,16 +173,16 @@ bool FilterOperationResolver::createFilterOperations(CSSValue inValue, const CSS
if (filterValue.length() != 1)
return false;
- CSSValue cssValue = filterValue.item(0);
+ const CSSValue& cssValue = filterValue.item(0);
if (!cssValue.isShadowValue())
continue;
CSSShadowValue& item = toCSSShadowValue(cssValue);
- IntPoint location(toCSSPrimitiveValue(*item.x).computeLength<int>(conversionData), toCSSPrimitiveValue(*item.y).computeLength<int>(conversionData));
- int blur = item.blur ? toCSSPrimitiveValue(*item.blur).computeLength<int>(conversionData) : 0;
+ IntPoint location(toCSSPrimitiveValue(item.x).computeLength<int>(conversionData), toCSSPrimitiveValue(item.y).computeLength<int>(conversionData));
+ int blur = item.blur ? toCSSPrimitiveValue(item.blur).computeLength<int>(conversionData) : 0;
Color shadowColor = Color::black;
if (item.color)
- shadowColor = state.document().textLinkColors().colorFromPrimitiveValue(toCSSPrimitiveValue(*item.color), state.style()->color());
+ shadowColor = state.document().textLinkColors().colorFromPrimitiveValue(toCSSPrimitiveValue(item.color), state.style()->color());
operations.operations().append(DropShadowFilterOperation::create(location, blur, shadowColor));
break;
« no previous file with comments | « Source/core/css/resolver/CSSToStyleMap.cpp ('k') | Source/core/css/resolver/StyleBuilder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698