| 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 "config.h" | 5 #include "config.h" |
| 6 #include "core/paint/SVGShapePainter.h" | 6 #include "core/paint/SVGShapePainter.h" |
| 7 | 7 |
| 8 #include "core/layout/svg/LayoutSVGPath.h" | 8 #include "core/layout/svg/LayoutSVGPath.h" |
| 9 #include "core/layout/svg/LayoutSVGResourceMarker.h" | 9 #include "core/layout/svg/LayoutSVGResourceMarker.h" |
| 10 #include "core/layout/svg/LayoutSVGShape.h" | 10 #include "core/layout/svg/LayoutSVGShape.h" |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 ASSERT(markerElement); | 205 ASSERT(markerElement); |
| 206 if (markerElement->hasAttribute(SVGNames::viewBoxAttr) && markerElement->vie
wBox()->currentValue()->isValid() && markerElement->viewBox()->currentValue()->v
alue().isEmpty()) | 206 if (markerElement->hasAttribute(SVGNames::viewBoxAttr) && markerElement->vie
wBox()->currentValue()->isValid() && markerElement->viewBox()->currentValue()->v
alue().isEmpty()) |
| 207 return; | 207 return; |
| 208 | 208 |
| 209 { | 209 { |
| 210 DisplayItemListContextRecorder contextRecorder(*paintInfo.context); | 210 DisplayItemListContextRecorder contextRecorder(*paintInfo.context); |
| 211 PaintInfo markerPaintInfo(paintInfo); | 211 PaintInfo markerPaintInfo(paintInfo); |
| 212 markerPaintInfo.context = &contextRecorder.context(); | 212 markerPaintInfo.context = &contextRecorder.context(); |
| 213 | 213 |
| 214 TransformRecorder transformRecorder(*markerPaintInfo.context, marker, ma
rker.markerTransformation(position.origin, position.angle, strokeWidth)); | 214 TransformRecorder transformRecorder(*markerPaintInfo.context, marker, ma
rker.markerTransformation(position.origin, position.angle, strokeWidth)); |
| 215 OwnPtr<FloatClipRecorder> clipRecorder; | 215 FloatClipRecorder clipRecorder(*markerPaintInfo.context, marker, markerP
aintInfo.phase); |
| 216 if (SVGLayoutSupport::isOverflowHidden(&marker)) | 216 if (SVGLayoutSupport::isOverflowHidden(&marker)) |
| 217 clipRecorder = adoptPtr(new FloatClipRecorder(*markerPaintInfo.conte
xt, marker, markerPaintInfo.phase, marker.viewport())); | 217 clipRecorder.begin(marker.viewport()); |
| 218 | 218 |
| 219 SVGContainerPainter(marker).paint(markerPaintInfo); | 219 SVGContainerPainter(marker).paint(markerPaintInfo); |
| 220 } | 220 } |
| 221 } | 221 } |
| 222 | 222 |
| 223 void SVGShapePainter::strokeZeroLengthLineCaps(GraphicsContext* context, const S
kPaint& strokePaint) | 223 void SVGShapePainter::strokeZeroLengthLineCaps(GraphicsContext* context, const S
kPaint& strokePaint) |
| 224 { | 224 { |
| 225 const Vector<FloatPoint>* zeroLengthLineCaps = m_layoutSVGShape.zeroLengthLi
neCaps(); | 225 const Vector<FloatPoint>* zeroLengthLineCaps = m_layoutSVGShape.zeroLengthLi
neCaps(); |
| 226 if (!zeroLengthLineCaps || zeroLengthLineCaps->isEmpty()) | 226 if (!zeroLengthLineCaps || zeroLengthLineCaps->isEmpty()) |
| 227 return; | 227 return; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 245 // This open-codes LayoutSVGShape::nonScalingStrokePath, because the | 245 // This open-codes LayoutSVGShape::nonScalingStrokePath, because the |
| 246 // requirements here differ (we have a temporary path that we can | 246 // requirements here differ (we have a temporary path that we can |
| 247 // mutate.) | 247 // mutate.) |
| 248 if (m_layoutSVGShape.hasNonScalingStroke()) | 248 if (m_layoutSVGShape.hasNonScalingStroke()) |
| 249 tempPath.transform(nonScalingTransform); | 249 tempPath.transform(nonScalingTransform); |
| 250 context->drawPath(tempPath.skPath(), fillPaint); | 250 context->drawPath(tempPath.skPath(), fillPaint); |
| 251 } | 251 } |
| 252 } | 252 } |
| 253 | 253 |
| 254 } // namespace blink | 254 } // namespace blink |
| OLD | NEW |