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

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

Issue 1376523002: Support 'pathLength' for stroking operations on <path> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove double space Created 4 years, 10 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
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 "core/paint/SVGInlineTextBoxPainter.h" 5 #include "core/paint/SVGInlineTextBoxPainter.h"
6 6
7 #include "core/editing/Editor.h" 7 #include "core/editing/Editor.h"
8 #include "core/editing/markers/DocumentMarkerController.h" 8 #include "core/editing/markers/DocumentMarkerController.h"
9 #include "core/editing/markers/RenderedDocumentMarker.h" 9 #include "core/editing/markers/RenderedDocumentMarker.h"
10 #include "core/frame/LocalFrame.h" 10 #include "core/frame/LocalFrame.h"
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 paintInfo.context.drawPath(path.skPath(), fillPaint); 264 paintInfo.context.drawPath(path.skPath(), fillPaint);
265 } 265 }
266 break; 266 break;
267 case PT_STROKE: 267 case PT_STROKE:
268 if (svgDecorationStyle.hasVisibleStroke()) { 268 if (svgDecorationStyle.hasVisibleStroke()) {
269 SkPaint strokePaint; 269 SkPaint strokePaint;
270 if (!SVGPaintContext::paintForLayoutObject(paintInfo, decoration Style, *decorationLayoutObject, ApplyToStrokeMode, strokePaint)) 270 if (!SVGPaintContext::paintForLayoutObject(paintInfo, decoration Style, *decorationLayoutObject, ApplyToStrokeMode, strokePaint))
271 break; 271 break;
272 strokePaint.setAntiAlias(true); 272 strokePaint.setAntiAlias(true);
273 StrokeData strokeData; 273 StrokeData strokeData;
274 SVGLayoutSupport::applyStrokeStyleToStrokeData(strokeData, decor ationStyle, *decorationLayoutObject); 274 SVGLayoutSupport::applyStrokeStyleToStrokeData(strokeData, decor ationStyle, *decorationLayoutObject, 1);
275 if (svgDecorationStyle.vectorEffect() == VE_NON_SCALING_STROKE) 275 if (svgDecorationStyle.vectorEffect() == VE_NON_SCALING_STROKE)
276 strokeData.setThickness(strokeData.thickness() / scalingFact or); 276 strokeData.setThickness(strokeData.thickness() / scalingFact or);
277 strokeData.setupPaint(&strokePaint); 277 strokeData.setupPaint(&strokePaint);
278 paintInfo.context.drawPath(path.skPath(), strokePaint); 278 paintInfo.context.drawPath(path.skPath(), strokePaint);
279 } 279 }
280 break; 280 break;
281 case PT_MARKERS: 281 case PT_MARKERS:
282 break; 282 break;
283 default: 283 default:
284 ASSERT_NOT_REACHED(); 284 ASSERT_NOT_REACHED();
(...skipping 28 matching lines...) Expand all
313 paint.setAntiAlias(true); 313 paint.setAntiAlias(true);
314 314
315 if (hasShadow) { 315 if (hasShadow) {
316 OwnPtr<DrawLooperBuilder> drawLooperBuilder = shadowList->createDrawLoop er(DrawLooperBuilder::ShadowRespectsAlpha, style.visitedDependentColor(CSSProper tyColor)); 316 OwnPtr<DrawLooperBuilder> drawLooperBuilder = shadowList->createDrawLoop er(DrawLooperBuilder::ShadowRespectsAlpha, style.visitedDependentColor(CSSProper tyColor));
317 RefPtr<SkDrawLooper> drawLooper = drawLooperBuilder->detachDrawLooper(); 317 RefPtr<SkDrawLooper> drawLooper = drawLooperBuilder->detachDrawLooper();
318 paint.setLooper(drawLooper.get()); 318 paint.setLooper(drawLooper.get());
319 } 319 }
320 320
321 if (resourceMode == ApplyToStrokeMode) { 321 if (resourceMode == ApplyToStrokeMode) {
322 StrokeData strokeData; 322 StrokeData strokeData;
323 SVGLayoutSupport::applyStrokeStyleToStrokeData(strokeData, style, *LineL ayoutAPIShim::layoutObjectFrom(m_svgInlineTextBox.parent()->lineLayoutItem())); 323 SVGLayoutSupport::applyStrokeStyleToStrokeData(strokeData, style, *LineL ayoutAPIShim::layoutObjectFrom(m_svgInlineTextBox.parent()->lineLayoutItem()), 1 );
324 if (style.svgStyle().vectorEffect() != VE_NON_SCALING_STROKE) 324 if (style.svgStyle().vectorEffect() != VE_NON_SCALING_STROKE)
325 strokeData.setThickness(strokeData.thickness() * scalingFactor); 325 strokeData.setThickness(strokeData.thickness() * scalingFactor);
326 strokeData.setupPaint(&paint); 326 strokeData.setupPaint(&paint);
327 } 327 }
328 return true; 328 return true;
329 } 329 }
330 330
331 void SVGInlineTextBoxPainter::paintText(const PaintInfo& paintInfo, TextRun& tex tRun, const SVGTextFragment& fragment, int startPosition, int endPosition, const SkPaint& paint) 331 void SVGInlineTextBoxPainter::paintText(const PaintInfo& paintInfo, TextRun& tex tRun, const SVGTextFragment& fragment, int startPosition, int endPosition, const SkPaint& paint)
332 { 332 {
333 LayoutSVGInlineText& textLayoutObject = toLayoutSVGInlineText(*LineLayoutAPI Shim::layoutObjectFrom(m_svgInlineTextBox.lineLayoutItem())); 333 LayoutSVGInlineText& textLayoutObject = toLayoutSVGInlineText(*LineLayoutAPI Shim::layoutObjectFrom(m_svgInlineTextBox.lineLayoutItem()));
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 stateSaver.save(); 496 stateSaver.save();
497 paintInfo.context.concatCTM(fragment.buildFragmentTransform()); 497 paintInfo.context.concatCTM(fragment.buildFragmentTransform());
498 } 498 }
499 FloatRect fragmentRect = m_svgInlineTextBox.selectionRectForTextFragment (fragment, textMatchInfo.startPosition, textMatchInfo.endPosition, style); 499 FloatRect fragmentRect = m_svgInlineTextBox.selectionRectForTextFragment (fragment, textMatchInfo.startPosition, textMatchInfo.endPosition, style);
500 paintInfo.context.setFillColor(color); 500 paintInfo.context.setFillColor(color);
501 paintInfo.context.fillRect(fragmentRect); 501 paintInfo.context.fillRect(fragmentRect);
502 } 502 }
503 } 503 }
504 504
505 } // namespace blink 505 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698