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

Unified Diff: Source/core/rendering/svg/SVGInlineTextBox.cpp

Issue 225023029: Apply SVG paint-order to text-decorations (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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/rendering/svg/SVGInlineTextBox.cpp
diff --git a/Source/core/rendering/svg/SVGInlineTextBox.cpp b/Source/core/rendering/svg/SVGInlineTextBox.cpp
index c7be22fe7c993f42ef39d518c2a7166cb20741e4..8ce2f10c49dd553932816ddbf4b601ca1886b23a 100644
--- a/Source/core/rendering/svg/SVGInlineTextBox.cpp
+++ b/Source/core/rendering/svg/SVGInlineTextBox.cpp
@@ -543,17 +543,25 @@ void SVGInlineTextBox::paintDecoration(GraphicsContext* context, TextDecoration
const SVGRenderStyle* svgDecorationStyle = decorationStyle->svgStyle();
ASSERT(svgDecorationStyle);
- bool hasDecorationFill = svgDecorationStyle->hasFill();
- bool hasVisibleDecorationStroke = svgDecorationStyle->hasVisibleStroke();
-
- if (hasDecorationFill) {
- m_paintingResourceMode = ApplyToFillMode;
- paintDecorationWithStyle(context, decoration, fragment, decorationRenderer);
- }
-
- if (hasVisibleDecorationStroke) {
- m_paintingResourceMode = ApplyToStrokeMode;
- paintDecorationWithStyle(context, decoration, fragment, decorationRenderer);
+ for (int i = 0; i < 3; i++) {
pdr. 2014/04/08 14:20:57 Question: can we share this with the loop above (i
fs 2014/04/08 15:50:24 No, not as long as the stroke+fill for the decorat
+ switch (svgDecorationStyle->paintOrderType(i)) {
+ case PT_FILL:
+ if (svgDecorationStyle->hasFill()) {
+ m_paintingResourceMode = ApplyToFillMode;
+ paintDecorationWithStyle(context, decoration, fragment, decorationRenderer);
+ }
+ break;
+ case PT_STROKE:
+ if (svgDecorationStyle->hasVisibleStroke()) {
+ m_paintingResourceMode = ApplyToStrokeMode;
+ paintDecorationWithStyle(context, decoration, fragment, decorationRenderer);
+ }
+ break;
+ case PT_MARKERS:
+ break;
+ default:
+ ASSERT_NOT_REACHED();
+ }
}
}

Powered by Google App Engine
This is Rietveld 408576698