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

Unified Diff: Source/core/css/ComputedStyleCSSValueMapping.cpp

Issue 1252933003: Shrink SVG paint-order to take less bits (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Align with review comments 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 | « no previous file | Source/core/css/parser/CSSPropertyParser.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/ComputedStyleCSSValueMapping.cpp
diff --git a/Source/core/css/ComputedStyleCSSValueMapping.cpp b/Source/core/css/ComputedStyleCSSValueMapping.cpp
index 06fa017c5f3c2e22a1b6f5a94e67795d9a40c9b7..3f0278c2d23f901eb408c6c38882a5dd662b1c37 100644
--- a/Source/core/css/ComputedStyleCSSValueMapping.cpp
+++ b/Source/core/css/ComputedStyleCSSValueMapping.cpp
@@ -1185,11 +1185,11 @@ static PassRefPtrWillBeRawPtr<CSSValue> strokeDashArrayToCSSValueList(const SVGD
return list.release();
}
-static PassRefPtrWillBeRawPtr<CSSValue> paintOrderToCSSValueList(EPaintOrder paintorder)
+static PassRefPtrWillBeRawPtr<CSSValue> paintOrderToCSSValueList(const SVGComputedStyle& svgStyle)
{
RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
- do {
- EPaintOrderType paintOrderType = (EPaintOrderType)(paintorder & ((1 << kPaintOrderBitwidth) - 1));
+ for (int i = 0; i < 3; i++) {
+ EPaintOrderType paintOrderType = svgStyle.paintOrderType(i);
switch (paintOrderType) {
case PT_FILL:
case PT_STROKE:
@@ -1201,7 +1201,7 @@ static PassRefPtrWillBeRawPtr<CSSValue> paintOrderToCSSValueList(EPaintOrder pai
ASSERT_NOT_REACHED();
break;
}
- } while (paintorder >>= kPaintOrderBitwidth);
+ }
return list.release();
}
@@ -2619,7 +2619,7 @@ PassRefPtrWillBeRawPtr<CSSValue> ComputedStyleCSSValueMapping::get(CSSPropertyID
return nullptr;
}
case CSSPropertyPaintOrder:
- return paintOrderToCSSValueList(svgStyle.paintOrder());
+ return paintOrderToCSSValueList(svgStyle);
case CSSPropertyVectorEffect:
return CSSPrimitiveValue::create(svgStyle.vectorEffect());
case CSSPropertyMaskType:
« no previous file with comments | « no previous file | Source/core/css/parser/CSSPropertyParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698