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

Unified Diff: Source/core/css/resolver/StyleBuilderConverter.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 | « Source/core/css/parser/CSSPropertyParser.cpp ('k') | Source/core/style/SVGComputedStyle.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/resolver/StyleBuilderConverter.cpp
diff --git a/Source/core/css/resolver/StyleBuilderConverter.cpp b/Source/core/css/resolver/StyleBuilderConverter.cpp
index c0e62fead1f50e243621548f65805909eb0bd0f6..3a23962ffc8dea317af0f543a92a0500117e8935 100644
--- a/Source/core/css/resolver/StyleBuilderConverter.cpp
+++ b/Source/core/css/resolver/StyleBuilderConverter.cpp
@@ -714,31 +714,21 @@ LengthPoint StyleBuilderConverter::convertPerspectiveOrigin(StyleResolverState&
EPaintOrder StyleBuilderConverter::convertPaintOrder(StyleResolverState&, CSSValue* cssPaintOrder)
{
if (cssPaintOrder->isValueList()) {
- int paintOrder = 0;
- const CSSValueList& list = *toCSSValueList(cssPaintOrder);
- for (size_t i = 0; i < list.length(); ++i) {
- EPaintOrderType paintOrderType = PT_NONE;
- switch (toCSSPrimitiveValue(list.item(i))->getValueID()) {
- case CSSValueFill:
- paintOrderType = PT_FILL;
- break;
- case CSSValueStroke:
- paintOrderType = PT_STROKE;
- break;
- case CSSValueMarkers:
- paintOrderType = PT_MARKERS;
- break;
- default:
- ASSERT_NOT_REACHED();
- break;
- }
-
- paintOrder |= (paintOrderType << kPaintOrderBitwidth*i);
+ const CSSValueList& orderTypeList = *toCSSValueList(cssPaintOrder);
+ switch (toCSSPrimitiveValue(orderTypeList.item(0))->getValueID()) {
+ case CSSValueFill:
+ return orderTypeList.length() > 1 ? PaintOrderFillMarkersStroke : PaintOrderFillStrokeMarkers;
+ case CSSValueStroke:
+ return orderTypeList.length() > 1 ? PaintOrderStrokeMarkersFill : PaintOrderStrokeFillMarkers;
+ case CSSValueMarkers:
+ return orderTypeList.length() > 1 ? PaintOrderMarkersStrokeFill : PaintOrderMarkersFillStroke;
+ default:
+ ASSERT_NOT_REACHED();
+ return PaintOrderNormal;
}
- return (EPaintOrder)paintOrder;
}
- return PO_NORMAL;
+ return PaintOrderNormal;
}
Length StyleBuilderConverter::convertQuirkyLength(StyleResolverState& state, CSSValue* value)
« no previous file with comments | « Source/core/css/parser/CSSPropertyParser.cpp ('k') | Source/core/style/SVGComputedStyle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698