OLD | NEW |
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 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 paintServerTransform.scale(scalingFactor); | 345 paintServerTransform.scale(scalingFactor); |
346 additionalPaintServerTransform = &paintServerTransform; | 346 additionalPaintServerTransform = &paintServerTransform; |
347 } | 347 } |
348 | 348 |
349 if (!SVGPaintContext::paintForLayoutObject(paintInfo, style, parentInlineLay
outObject(), resourceMode, paint, additionalPaintServerTransform)) | 349 if (!SVGPaintContext::paintForLayoutObject(paintInfo, style, parentInlineLay
outObject(), resourceMode, paint, additionalPaintServerTransform)) |
350 return false; | 350 return false; |
351 paint.setAntiAlias(true); | 351 paint.setAntiAlias(true); |
352 | 352 |
353 if (hasShadow(paintInfo, style)) { | 353 if (hasShadow(paintInfo, style)) { |
354 std::unique_ptr<DrawLooperBuilder> drawLooperBuilder = style.textShadow(
)->createDrawLooper(DrawLooperBuilder::ShadowRespectsAlpha, style.visitedDepende
ntColor(CSSPropertyColor)); | 354 std::unique_ptr<DrawLooperBuilder> drawLooperBuilder = style.textShadow(
)->createDrawLooper(DrawLooperBuilder::ShadowRespectsAlpha, style.visitedDepende
ntColor(CSSPropertyColor)); |
355 paint.setLooper(toSkSp(drawLooperBuilder->detachDrawLooper())); | 355 paint.setLooper(drawLooperBuilder->detachDrawLooper()); |
356 } | 356 } |
357 | 357 |
358 if (resourceMode == ApplyToStrokeMode) { | 358 if (resourceMode == ApplyToStrokeMode) { |
359 StrokeData strokeData; | 359 StrokeData strokeData; |
360 SVGLayoutSupport::applyStrokeStyleToStrokeData(strokeData, style, parent
InlineLayoutObject(), 1); | 360 SVGLayoutSupport::applyStrokeStyleToStrokeData(strokeData, style, parent
InlineLayoutObject(), 1); |
361 if (style.svgStyle().vectorEffect() != VE_NON_SCALING_STROKE) | 361 if (style.svgStyle().vectorEffect() != VE_NON_SCALING_STROKE) |
362 strokeData.setThickness(strokeData.thickness() * scalingFactor); | 362 strokeData.setThickness(strokeData.thickness() * scalingFactor); |
363 strokeData.setupPaint(&paint); | 363 strokeData.setupPaint(&paint); |
364 } | 364 } |
365 return true; | 365 return true; |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 stateSaver.save(); | 533 stateSaver.save(); |
534 paintInfo.context.concatCTM(fragment.buildFragmentTransform()); | 534 paintInfo.context.concatCTM(fragment.buildFragmentTransform()); |
535 } | 535 } |
536 FloatRect fragmentRect = m_svgInlineTextBox.selectionRectForTextFragment
(fragment, textMatchInfo.startPosition, textMatchInfo.endPosition, style); | 536 FloatRect fragmentRect = m_svgInlineTextBox.selectionRectForTextFragment
(fragment, textMatchInfo.startPosition, textMatchInfo.endPosition, style); |
537 paintInfo.context.setFillColor(color); | 537 paintInfo.context.setFillColor(color); |
538 paintInfo.context.fillRect(fragmentRect); | 538 paintInfo.context.fillRect(fragmentRect); |
539 } | 539 } |
540 } | 540 } |
541 | 541 |
542 } // namespace blink | 542 } // namespace blink |
OLD | NEW |