| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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::Visible || |
| 49 m_layoutSVGShape.isShapeEmpty()) | 49 m_layoutSVGShape.isShapeEmpty()) |
| 50 return; | 50 return; |
| 51 | 51 |
| 52 FloatRect boundingBox = | 52 FloatRect boundingBox = m_layoutSVGShape.visualRectInLocalSVGCoordinates(); |
| 53 m_layoutSVGShape.paintInvalidationRectInLocalSVGCoordinates(); | |
| 54 if (!paintInfo.cullRect().intersectsCullRect( | 53 if (!paintInfo.cullRect().intersectsCullRect( |
| 55 m_layoutSVGShape.localSVGTransform(), boundingBox)) | 54 m_layoutSVGShape.localSVGTransform(), boundingBox)) |
| 56 return; | 55 return; |
| 57 | 56 |
| 58 PaintInfo paintInfoBeforeFiltering(paintInfo); | 57 PaintInfo paintInfoBeforeFiltering(paintInfo); |
| 59 // Shapes cannot have children so do not call updateCullRect. | 58 // Shapes cannot have children so do not call updateCullRect. |
| 60 SVGTransformContext transformContext(paintInfoBeforeFiltering.context, | 59 SVGTransformContext transformContext(paintInfoBeforeFiltering.context, |
| 61 m_layoutSVGShape, | 60 m_layoutSVGShape, |
| 62 m_layoutSVGShape.localSVGTransform()); | 61 m_layoutSVGShape.localSVGTransform()); |
| 63 { | 62 { |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 marker.markerTransformation(position.origin, position.angle, | 246 marker.markerTransformation(position.origin, position.angle, |
| 248 strokeWidth)); | 247 strokeWidth)); |
| 249 Optional<FloatClipRecorder> clipRecorder; | 248 Optional<FloatClipRecorder> clipRecorder; |
| 250 if (SVGLayoutSupport::isOverflowHidden(&marker)) | 249 if (SVGLayoutSupport::isOverflowHidden(&marker)) |
| 251 clipRecorder.emplace(paintInfo.context, marker, paintInfo.phase, | 250 clipRecorder.emplace(paintInfo.context, marker, paintInfo.phase, |
| 252 marker.viewport()); | 251 marker.viewport()); |
| 253 SVGContainerPainter(marker).paint(paintInfo); | 252 SVGContainerPainter(marker).paint(paintInfo); |
| 254 } | 253 } |
| 255 | 254 |
| 256 } // namespace blink | 255 } // namespace blink |
| OLD | NEW |