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

Unified Diff: Source/core/style/SVGComputedStyle.cpp

Issue 1252933003: Shrink SVG paint-order to take less bits (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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
Index: Source/core/style/SVGComputedStyle.cpp
diff --git a/Source/core/style/SVGComputedStyle.cpp b/Source/core/style/SVGComputedStyle.cpp
index 36b237672bf134d7b8ec97ba5448eca2edf3e5b1..8cf16fbb68a4c986399e967f5575c3b375214ab1 100644
--- a/Source/core/style/SVGComputedStyle.cpp
+++ b/Source/core/style/SVGComputedStyle.cpp
@@ -236,7 +236,7 @@ bool SVGComputedStyle::diffNeedsPaintInvalidation(const SVGComputedStyle* other)
|| svg_inherited_flags._fillRule != other->svg_inherited_flags._fillRule
|| svg_inherited_flags._colorInterpolation != other->svg_inherited_flags._colorInterpolation
|| svg_inherited_flags._colorInterpolationFilters != other->svg_inherited_flags._colorInterpolationFilters
- || svg_inherited_flags._paintOrder != other->svg_inherited_flags._paintOrder)
+ || svg_inherited_flags.paintOrder != other->svg_inherited_flags.paintOrder)
return true;
if (svg_noninherited_flags.f.bufferedRendering != other->svg_noninherited_flags.f.bufferedRendering)
@@ -248,11 +248,44 @@ bool SVGComputedStyle::diffNeedsPaintInvalidation(const SVGComputedStyle* other)
return false;
}
-EPaintOrderType SVGComputedStyle::paintOrderType(unsigned index) const
+Vector<EPaintOrderType, 3> SVGComputedStyle::paintTypesForPaintOrder() const
pdr. 2015/07/29 05:20:50 Returning a Vector seems a bit heavy for this code
Shanmuga Pandi 2015/07/29 06:55:04 Ok. I will try to change the code as you suggested
{
- ASSERT(index < ((1 << kPaintOrderBitwidth)-1));
- unsigned pt = (paintOrder() >> (kPaintOrderBitwidth*index)) & ((1u << kPaintOrderBitwidth) - 1);
- return (EPaintOrderType)pt;
+ Vector<EPaintOrderType, 3> paintOrder;
+ switch (this->paintOrder()) {
+ case PaintOrderNormal:
+ case PaintOrderFill:
+ paintOrder.append(PT_FILL);
+ paintOrder.append(PT_STROKE);
+ paintOrder.append(PT_MARKERS);
+ break;
+ case PaintOrderFillMarkers:
+ paintOrder.append(PT_FILL);
+ paintOrder.append(PT_MARKERS);
+ paintOrder.append(PT_STROKE);
+ break;
+ case PaintOrderStroke:
+ paintOrder.append(PT_STROKE);
+ paintOrder.append(PT_FILL);
+ paintOrder.append(PT_MARKERS);
+ break;
+ case PaintOrderStrokeMarkers:
+ paintOrder.append(PT_STROKE);
+ paintOrder.append(PT_MARKERS);
+ paintOrder.append(PT_FILL);
+ break;
+ case PaintOrderMarkers:
+ paintOrder.append(PT_MARKERS);
+ paintOrder.append(PT_FILL);
+ paintOrder.append(PT_STROKE);
+ break;
+ case PaintOrderMarkersStroke:
+ paintOrder.append(PT_MARKERS);
+ paintOrder.append(PT_STROKE);
+ paintOrder.append(PT_FILL);
+ break;
+ }
+
+ return paintOrder;
}
}

Powered by Google App Engine
This is Rietveld 408576698