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

Side by Side Diff: Source/core/paint/SVGInlineTextBoxPainter.cpp

Issue 1107983003: SVG Text decoration should respect non-scaling-stroke. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebased Created 5 years, 7 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 unified diff | Download patch
« no previous file with comments | « LayoutTests/svg/stroke/non-scaling-stroke-text-decoration-expected.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "core/paint/SVGInlineTextBoxPainter.h" 6 #include "core/paint/SVGInlineTextBoxPainter.h"
7 7
8 #include "core/dom/DocumentMarkerController.h" 8 #include "core/dom/DocumentMarkerController.h"
9 #include "core/dom/RenderedDocumentMarker.h" 9 #include "core/dom/RenderedDocumentMarker.h"
10 #include "core/editing/Editor.h" 10 #include "core/editing/Editor.h"
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 if (svgDecorationStyle.hasFill()) { 271 if (svgDecorationStyle.hasFill()) {
272 SkPaint fillPaint; 272 SkPaint fillPaint;
273 if (!SVGPaintContext::paintForLayoutObject(paintInfo, decoration Style, *decorationRenderer, ApplyToFillMode, fillPaint)) 273 if (!SVGPaintContext::paintForLayoutObject(paintInfo, decoration Style, *decorationRenderer, ApplyToFillMode, fillPaint))
274 break; 274 break;
275 fillPaint.setAntiAlias(true); 275 fillPaint.setAntiAlias(true);
276 paintInfo.context->drawPath(path.skPath(), fillPaint); 276 paintInfo.context->drawPath(path.skPath(), fillPaint);
277 } 277 }
278 break; 278 break;
279 case PT_STROKE: 279 case PT_STROKE:
280 if (svgDecorationStyle.hasVisibleStroke()) { 280 if (svgDecorationStyle.hasVisibleStroke()) {
281 // FIXME: Non-scaling stroke is not applied here.
282 SkPaint strokePaint; 281 SkPaint strokePaint;
283 if (!SVGPaintContext::paintForLayoutObject(paintInfo, decoration Style, *decorationRenderer, ApplyToStrokeMode, strokePaint)) 282 if (!SVGPaintContext::paintForLayoutObject(paintInfo, decoration Style, *decorationRenderer, ApplyToStrokeMode, strokePaint))
284 break; 283 break;
285 strokePaint.setAntiAlias(true); 284 strokePaint.setAntiAlias(true);
286 StrokeData strokeData; 285 StrokeData strokeData;
287 SVGLayoutSupport::applyStrokeStyleToStrokeData(strokeData, decor ationStyle, *decorationRenderer); 286 SVGLayoutSupport::applyStrokeStyleToStrokeData(strokeData, decor ationStyle, *decorationRenderer);
287 if (svgDecorationStyle.vectorEffect() == VE_NON_SCALING_STROKE)
288 strokeData.setThickness(strokeData.thickness() / scalingFact or);
288 strokeData.setupPaint(&strokePaint); 289 strokeData.setupPaint(&strokePaint);
289 paintInfo.context->drawPath(path.skPath(), strokePaint); 290 paintInfo.context->drawPath(path.skPath(), strokePaint);
290 } 291 }
291 break; 292 break;
292 case PT_MARKERS: 293 case PT_MARKERS:
293 break; 294 break;
294 default: 295 default:
295 ASSERT_NOT_REACHED(); 296 ASSERT_NOT_REACHED();
296 } 297 }
297 } 298 }
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 if (!fragmentTransform.isIdentity()) 446 if (!fragmentTransform.isIdentity())
446 context->concatCTM(fragmentTransform); 447 context->concatCTM(fragmentTransform);
447 context->setFillColor(color); 448 context->setFillColor(color);
448 context->fillRect(fragmentRect, color); 449 context->fillRect(fragmentRect, color);
449 } 450 }
450 } 451 }
451 } 452 }
452 } 453 }
453 454
454 } // namespace blink 455 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/svg/stroke/non-scaling-stroke-text-decoration-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698