| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 | 49 |
| 50 FloatRect boundingBox = m_layoutSVGShape.paintInvalidationRectInLocalCoordin
ates(); | 50 FloatRect boundingBox = m_layoutSVGShape.paintInvalidationRectInLocalCoordin
ates(); |
| 51 if (!paintInfo.cullRect().intersectsCullRect(m_layoutSVGShape.localTransform
(), boundingBox)) | 51 if (!paintInfo.cullRect().intersectsCullRect(m_layoutSVGShape.localTransform
(), boundingBox)) |
| 52 return; | 52 return; |
| 53 | 53 |
| 54 PaintInfo paintInfoBeforeFiltering(paintInfo); | 54 PaintInfo paintInfoBeforeFiltering(paintInfo); |
| 55 // Shapes cannot have children so do not call updateCullRect. | 55 // Shapes cannot have children so do not call updateCullRect. |
| 56 TransformRecorder transformRecorder(paintInfoBeforeFiltering.context, m_layo
utSVGShape, m_layoutSVGShape.localTransform()); | 56 TransformRecorder transformRecorder(paintInfoBeforeFiltering.context, m_layo
utSVGShape, m_layoutSVGShape.localTransform()); |
| 57 { | 57 { |
| 58 SVGPaintContext paintContext(m_layoutSVGShape, paintInfoBeforeFiltering)
; | 58 SVGPaintContext paintContext(m_layoutSVGShape, paintInfoBeforeFiltering)
; |
| 59 if (paintContext.applyClipMaskAndFilterIfNecessary() && !LayoutObjectDra
wingRecorder::useCachedDrawingIfPossible(paintContext.paintInfo().context, m_lay
outSVGShape, paintContext.paintInfo().phase, LayoutPoint())) { | 59 if (paintContext.applyClipMaskAndFilterIfNecessary() && !LayoutObjectDra
wingRecorder::useCachedDrawingIfPossible(paintContext.paintInfo().context, m_lay
outSVGShape, paintContext.paintInfo().phase)) { |
| 60 LayoutObjectDrawingRecorder recorder(paintContext.paintInfo().contex
t, m_layoutSVGShape, paintContext.paintInfo().phase, boundingBox, LayoutPoint())
; | 60 LayoutObjectDrawingRecorder recorder(paintContext.paintInfo().contex
t, m_layoutSVGShape, paintContext.paintInfo().phase, boundingBox); |
| 61 const SVGComputedStyle& svgStyle = m_layoutSVGShape.style()->svgStyl
e(); | 61 const SVGComputedStyle& svgStyle = m_layoutSVGShape.style()->svgStyl
e(); |
| 62 | 62 |
| 63 bool shouldAntiAlias = svgStyle.shapeRendering() != SR_CRISPEDGES; | 63 bool shouldAntiAlias = svgStyle.shapeRendering() != SR_CRISPEDGES; |
| 64 | 64 |
| 65 for (int i = 0; i < 3; i++) { | 65 for (int i = 0; i < 3; i++) { |
| 66 switch (svgStyle.paintOrderType(i)) { | 66 switch (svgStyle.paintOrderType(i)) { |
| 67 case PT_FILL: { | 67 case PT_FILL: { |
| 68 SkPaint fillPaint; | 68 SkPaint fillPaint; |
| 69 if (!SVGPaintContext::paintForLayoutObject(paintContext.pain
tInfo(), m_layoutSVGShape.styleRef(), m_layoutSVGShape, ApplyToFillMode, fillPai
nt)) | 69 if (!SVGPaintContext::paintForLayoutObject(paintContext.pain
tInfo(), m_layoutSVGShape.styleRef(), m_layoutSVGShape, ApplyToFillMode, fillPai
nt)) |
| 70 break; | 70 break; |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 return; | 218 return; |
| 219 | 219 |
| 220 TransformRecorder transformRecorder(paintInfo.context, marker, marker.marker
Transformation(position.origin, position.angle, strokeWidth)); | 220 TransformRecorder transformRecorder(paintInfo.context, marker, marker.marker
Transformation(position.origin, position.angle, strokeWidth)); |
| 221 Optional<FloatClipRecorder> clipRecorder; | 221 Optional<FloatClipRecorder> clipRecorder; |
| 222 if (SVGLayoutSupport::isOverflowHidden(&marker)) | 222 if (SVGLayoutSupport::isOverflowHidden(&marker)) |
| 223 clipRecorder.emplace(paintInfo.context, marker, paintInfo.phase, marker.
viewport()); | 223 clipRecorder.emplace(paintInfo.context, marker, paintInfo.phase, marker.
viewport()); |
| 224 SVGContainerPainter(marker).paint(paintInfo); | 224 SVGContainerPainter(marker).paint(paintInfo); |
| 225 } | 225 } |
| 226 | 226 |
| 227 } // namespace blink | 227 } // namespace blink |
| OLD | NEW |