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

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

Issue 1249553002: CSSValue Immediates: Add move operators to CSSPrimitiveValue (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@cssvalue_patch_3_tagged_ptrs_with_copy_ops_mv_operators_ref_primvalue
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/StyleBuilderCustom.cpp ('k') | Source/core/css/resolver/ViewportStyleResolver.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/resolver/TransformBuilder.cpp
diff --git a/Source/core/css/resolver/TransformBuilder.cpp b/Source/core/css/resolver/TransformBuilder.cpp
index 471d6fe58b5b977c0e0b84935c7a97fd55485b06..306eb86555e7548f589a9d0298aa172215abdd0e 100644
--- a/Source/core/css/resolver/TransformBuilder.cpp
+++ b/Source/core/css/resolver/TransformBuilder.cpp
@@ -43,7 +43,7 @@
namespace blink {
-static Length convertToFloatLength(CSSPrimitiveValue& primitiveValue, const CSSToLengthConversionData& conversionData)
+static Length convertToFloatLength(CSSPrimitiveValue primitiveValue, const CSSToLengthConversionData& conversionData)
{
return primitiveValue.convertToLength(conversionData);
}
@@ -92,7 +92,7 @@ void TransformBuilder::createTransformOperations(const CSSValue& inValue, const
CSSFunctionValue& transformValue = toCSSFunctionValue(value);
TransformOperation::OperationType transformType = getTransformOperationType(transformValue.functionType());
- CSSPrimitiveValue& firstValue = toCSSPrimitiveValue(transformValue.item(0));
+ const CSSPrimitiveValue& firstValue = toCSSPrimitiveValue(transformValue.item(0));
switch (transformType) {
case TransformOperation::Scale:
@@ -106,7 +106,7 @@ void TransformBuilder::createTransformOperations(const CSSValue& inValue, const
sx = firstValue.getDoubleValue();
if (transformType != TransformOperation::ScaleX) {
if (transformValue.length() > 1) {
- CSSPrimitiveValue& secondValue = toCSSPrimitiveValue(transformValue.item(1));
+ const CSSPrimitiveValue& secondValue = toCSSPrimitiveValue(transformValue.item(1));
sy = secondValue.getDoubleValue();
} else {
sy = sx;
@@ -142,7 +142,7 @@ void TransformBuilder::createTransformOperations(const CSSValue& inValue, const
tx = convertToFloatLength(firstValue, conversionData);
if (transformType != TransformOperation::TranslateX) {
if (transformValue.length() > 1) {
- CSSPrimitiveValue& secondValue = toCSSPrimitiveValue(transformValue.item(1));
+ const CSSPrimitiveValue& secondValue = toCSSPrimitiveValue(transformValue.item(1));
ty = convertToFloatLength(secondValue, conversionData);
}
}
@@ -178,9 +178,9 @@ void TransformBuilder::createTransformOperations(const CSSValue& inValue, const
break;
}
case TransformOperation::Rotate3D: {
- CSSPrimitiveValue& secondValue = toCSSPrimitiveValue(transformValue.item(1));
- CSSPrimitiveValue& thirdValue = toCSSPrimitiveValue(transformValue.item(2));
- CSSPrimitiveValue& fourthValue = toCSSPrimitiveValue(transformValue.item(3));
+ const CSSPrimitiveValue& secondValue = toCSSPrimitiveValue(transformValue.item(1));
+ const CSSPrimitiveValue& thirdValue = toCSSPrimitiveValue(transformValue.item(2));
+ const CSSPrimitiveValue& fourthValue = toCSSPrimitiveValue(transformValue.item(3));
double x = firstValue.getDoubleValue();
double y = secondValue.getDoubleValue();
double z = thirdValue.getDoubleValue();
@@ -200,7 +200,7 @@ void TransformBuilder::createTransformOperations(const CSSValue& inValue, const
angleX = angle;
if (transformType == TransformOperation::Skew) {
if (transformValue.length() > 1) {
- CSSPrimitiveValue& secondValue = toCSSPrimitiveValue(transformValue.item(1));
+ const CSSPrimitiveValue& secondValue = toCSSPrimitiveValue(transformValue.item(1));
angleY = secondValue.computeDegrees();
}
}
« no previous file with comments | « Source/core/css/resolver/StyleBuilderCustom.cpp ('k') | Source/core/css/resolver/ViewportStyleResolver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698