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 27 matching lines...) Expand all Loading... |
38 | 38 |
39 static SkPath::FillType fillRuleFromStyle(const PaintInfo& paintInfo, | 39 static SkPath::FillType fillRuleFromStyle(const PaintInfo& paintInfo, |
40 const SVGComputedStyle& svgStyle) { | 40 const SVGComputedStyle& svgStyle) { |
41 return WebCoreWindRuleToSkFillType(paintInfo.isRenderingClipPathAsMaskImage() | 41 return WebCoreWindRuleToSkFillType(paintInfo.isRenderingClipPathAsMaskImage() |
42 ? svgStyle.clipRule() | 42 ? svgStyle.clipRule() |
43 : svgStyle.fillRule()); | 43 : svgStyle.fillRule()); |
44 } | 44 } |
45 | 45 |
46 void SVGShapePainter::paint(const PaintInfo& paintInfo) { | 46 void SVGShapePainter::paint(const PaintInfo& paintInfo) { |
47 if (paintInfo.phase != PaintPhaseForeground || | 47 if (paintInfo.phase != PaintPhaseForeground || |
48 m_layoutSVGShape.style()->visibility() != EVisibility::Visible || | 48 m_layoutSVGShape.style()->visibility() != EVisibility::kVisible || |
49 m_layoutSVGShape.isShapeEmpty()) | 49 m_layoutSVGShape.isShapeEmpty()) |
50 return; | 50 return; |
51 | 51 |
52 FloatRect boundingBox = m_layoutSVGShape.visualRectInLocalSVGCoordinates(); | 52 FloatRect boundingBox = m_layoutSVGShape.visualRectInLocalSVGCoordinates(); |
53 if (!paintInfo.cullRect().intersectsCullRect( | 53 if (!paintInfo.cullRect().intersectsCullRect( |
54 m_layoutSVGShape.localSVGTransform(), boundingBox)) | 54 m_layoutSVGShape.localSVGTransform(), boundingBox)) |
55 return; | 55 return; |
56 | 56 |
57 PaintInfo paintInfoBeforeFiltering(paintInfo); | 57 PaintInfo paintInfoBeforeFiltering(paintInfo); |
58 // Shapes cannot have children so do not call updateCullRect. | 58 // Shapes cannot have children so do not call updateCullRect. |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 marker.markerTransformation(position.origin, position.angle, | 246 marker.markerTransformation(position.origin, position.angle, |
247 strokeWidth)); | 247 strokeWidth)); |
248 Optional<FloatClipRecorder> clipRecorder; | 248 Optional<FloatClipRecorder> clipRecorder; |
249 if (SVGLayoutSupport::isOverflowHidden(&marker)) | 249 if (SVGLayoutSupport::isOverflowHidden(&marker)) |
250 clipRecorder.emplace(paintInfo.context, marker, paintInfo.phase, | 250 clipRecorder.emplace(paintInfo.context, marker, paintInfo.phase, |
251 marker.viewport()); | 251 marker.viewport()); |
252 SVGContainerPainter(marker).paint(paintInfo); | 252 SVGContainerPainter(marker).paint(paintInfo); |
253 } | 253 } |
254 | 254 |
255 } // namespace blink | 255 } // namespace blink |
OLD | NEW |