| 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/SVGRootPainter.h" | 5 #include "core/paint/SVGRootPainter.h" |
| 6 | 6 |
| 7 #include "core/layout/svg/LayoutSVGRoot.h" | 7 #include "core/layout/svg/LayoutSVGRoot.h" |
| 8 #include "core/layout/svg/SVGLayoutSupport.h" | 8 #include "core/layout/svg/SVGLayoutSupport.h" |
| 9 #include "core/paint/BoxClipper.h" | 9 #include "core/paint/BoxClipper.h" |
| 10 #include "core/paint/BoxPainter.h" | 10 #include "core/paint/BoxPainter.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 paintOffsetToBorderBox.multiply(m_layoutSVGRoot.localToBorderBoxTransform()); | 36 paintOffsetToBorderBox.multiply(m_layoutSVGRoot.localToBorderBoxTransform()); |
| 37 return paintOffsetToBorderBox; | 37 return paintOffsetToBorderBox; |
| 38 } | 38 } |
| 39 | 39 |
| 40 void SVGRootPainter::paintReplaced(const PaintInfo& paintInfo, | 40 void SVGRootPainter::paintReplaced(const PaintInfo& paintInfo, |
| 41 const LayoutPoint& paintOffset) { | 41 const LayoutPoint& paintOffset) { |
| 42 // An empty viewport disables rendering. | 42 // An empty viewport disables rendering. |
| 43 if (pixelSnappedSize(paintOffset).isEmpty()) | 43 if (pixelSnappedSize(paintOffset).isEmpty()) |
| 44 return; | 44 return; |
| 45 | 45 |
| 46 // SVG outlines are painted during PaintPhaseForeground. | |
| 47 if (shouldPaintSelfOutline(paintInfo.phase)) | |
| 48 return; | |
| 49 | |
| 50 // An empty viewBox also disables rendering. | 46 // An empty viewBox also disables rendering. |
| 51 // (http://www.w3.org/TR/SVG/coords.html#ViewBoxAttribute) | 47 // (http://www.w3.org/TR/SVG/coords.html#ViewBoxAttribute) |
| 52 SVGSVGElement* svg = toSVGSVGElement(m_layoutSVGRoot.node()); | 48 SVGSVGElement* svg = toSVGSVGElement(m_layoutSVGRoot.node()); |
| 53 DCHECK(svg); | 49 DCHECK(svg); |
| 54 if (svg->hasEmptyViewBox()) | 50 if (svg->hasEmptyViewBox()) |
| 55 return; | 51 return; |
| 56 | 52 |
| 57 // Apply initial viewport clip. | 53 // Apply initial viewport clip. |
| 58 Optional<BoxClipper> boxClipper; | 54 Optional<BoxClipper> boxClipper; |
| 59 if (m_layoutSVGRoot.shouldApplyViewportClip()) { | 55 if (m_layoutSVGRoot.shouldApplyViewportClip()) { |
| (...skipping 16 matching lines...) Expand all Loading... |
| 76 | 72 |
| 77 BoxPainter(m_layoutSVGRoot) | 73 BoxPainter(m_layoutSVGRoot) |
| 78 .paintChildren(paintContext.paintInfo(), LayoutPoint()); | 74 .paintChildren(paintContext.paintInfo(), LayoutPoint()); |
| 79 | 75 |
| 80 PaintTiming& timing = | 76 PaintTiming& timing = |
| 81 PaintTiming::from(m_layoutSVGRoot.node()->document().topDocument()); | 77 PaintTiming::from(m_layoutSVGRoot.node()->document().topDocument()); |
| 82 timing.markFirstContentfulPaint(); | 78 timing.markFirstContentfulPaint(); |
| 83 } | 79 } |
| 84 | 80 |
| 85 } // namespace blink | 81 } // namespace blink |
| OLD | NEW |