| 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/SVGShapePainter.h" | 5 #include "core/paint/SVGShapePainter.h" |
| 6 | 6 |
| 7 #include "core/layout/svg/LayoutSVGResourceMarker.h" | 7 #include "core/layout/svg/LayoutSVGResourceMarker.h" |
| 8 #include "core/layout/svg/LayoutSVGShape.h" | 8 #include "core/layout/svg/LayoutSVGShape.h" |
| 9 #include "core/layout/svg/SVGLayoutSupport.h" | 9 #include "core/layout/svg/SVGLayoutSupport.h" |
| 10 #include "core/layout/svg/SVGMarkerData.h" | 10 #include "core/layout/svg/SVGMarkerData.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 AffineTransform nonScalingTransform; | 94 AffineTransform nonScalingTransform; |
| 95 const AffineTransform* additionalPaintServerTransform = 0; | 95 const AffineTransform* additionalPaintServerTransform = 0; |
| 96 | 96 |
| 97 if (m_layoutSVGShape.hasNonScalingStroke()) { | 97 if (m_layoutSVGShape.hasNonScalingStroke()) { |
| 98 nonScalingTransform = | 98 nonScalingTransform = |
| 99 m_layoutSVGShape.nonScalingStrokeTransform(); | 99 m_layoutSVGShape.nonScalingStrokeTransform(); |
| 100 if (!setupNonScalingStrokeContext(nonScalingTransform, | 100 if (!setupNonScalingStrokeContext(nonScalingTransform, |
| 101 stateSaver)) | 101 stateSaver)) |
| 102 return; | 102 return; |
| 103 | 103 |
| 104 // Non-scaling stroke needs to reset the transform back to the h
ost transform. | 104 // Non-scaling stroke needs to reset the transform back to the |
| 105 // host transform. |
| 105 additionalPaintServerTransform = &nonScalingTransform; | 106 additionalPaintServerTransform = &nonScalingTransform; |
| 106 } | 107 } |
| 107 | 108 |
| 108 SkPaint strokePaint; | 109 SkPaint strokePaint; |
| 109 if (!SVGPaintContext::paintForLayoutObject( | 110 if (!SVGPaintContext::paintForLayoutObject( |
| 110 paintContext.paintInfo(), m_layoutSVGShape.styleRef(), | 111 paintContext.paintInfo(), m_layoutSVGShape.styleRef(), |
| 111 m_layoutSVGShape, ApplyToStrokeMode, strokePaint, | 112 m_layoutSVGShape, ApplyToStrokeMode, strokePaint, |
| 112 additionalPaintServerTransform)) | 113 additionalPaintServerTransform)) |
| 113 break; | 114 break; |
| 114 strokePaint.setAntiAlias(shouldAntiAlias); | 115 strokePaint.setAntiAlias(shouldAntiAlias); |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 marker.markerTransformation(position.origin, position.angle, | 247 marker.markerTransformation(position.origin, position.angle, |
| 247 strokeWidth)); | 248 strokeWidth)); |
| 248 Optional<FloatClipRecorder> clipRecorder; | 249 Optional<FloatClipRecorder> clipRecorder; |
| 249 if (SVGLayoutSupport::isOverflowHidden(&marker)) | 250 if (SVGLayoutSupport::isOverflowHidden(&marker)) |
| 250 clipRecorder.emplace(paintInfo.context, marker, paintInfo.phase, | 251 clipRecorder.emplace(paintInfo.context, marker, paintInfo.phase, |
| 251 marker.viewport()); | 252 marker.viewport()); |
| 252 SVGContainerPainter(marker).paint(paintInfo); | 253 SVGContainerPainter(marker).paint(paintInfo); |
| 253 } | 254 } |
| 254 | 255 |
| 255 } // namespace blink | 256 } // namespace blink |
| OLD | NEW |