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

Unified Diff: Source/core/paint/SVGInlineTextBoxPainter.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/paint/SVGInlineTextBoxPainter.cpp
diff --git a/Source/core/paint/SVGInlineTextBoxPainter.cpp b/Source/core/paint/SVGInlineTextBoxPainter.cpp
index 98a34802c9b50607fa83f4f6c6f7d28faf286d4e..a521108abcb33830c7a13741a54d29fc00988b6a 100644
--- a/Source/core/paint/SVGInlineTextBoxPainter.cpp
+++ b/Source/core/paint/SVGInlineTextBoxPainter.cpp
@@ -118,8 +118,9 @@ void SVGInlineTextBoxPainter::paintTextFragments(const PaintInfo& paintInfo, Lay
if (decorations & TextDecorationOverline)
paintDecoration(paintInfo, TextDecorationOverline, fragment);
- for (int i = 0; i < 3; i++) {
- switch (svgStyle.paintOrderType(i)) {
+ auto paintOrder = svgStyle.paintTypesForPaintOrder();
+ for (unsigned i = 0; i < paintOrder.size(); ++i) {
+ switch (paintOrder.at(i)) {
case PT_FILL:
if (hasFill)
paintText(paintInfo, style, *selectionStyle, fragment, ApplyToFillMode, shouldPaintSelection);
@@ -260,8 +261,9 @@ void SVGInlineTextBoxPainter::paintDecoration(const PaintInfo& paintInfo, TextDe
const SVGComputedStyle& svgDecorationStyle = decorationStyle.svgStyle();
- for (int i = 0; i < 3; i++) {
- switch (svgDecorationStyle.paintOrderType(i)) {
+ auto paintOrder = svgDecorationStyle.paintTypesForPaintOrder();
+ for (unsigned i = 0; i < paintOrder.size(); ++i) {
+ switch (paintOrder.at(i)) {
case PT_FILL:
if (svgDecorationStyle.hasFill()) {
SkPaint fillPaint;

Powered by Google App Engine
This is Rietveld 408576698