OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/SVGClipPainter.h" | 5 #include "core/paint/SVGClipPainter.h" |
6 | 6 |
7 #include "core/dom/ElementTraversal.h" | 7 #include "core/dom/ElementTraversal.h" |
8 #include "core/layout/svg/LayoutSVGResourceClipper.h" | 8 #include "core/layout/svg/LayoutSVGResourceClipper.h" |
9 #include "core/layout/svg/SVGLayoutSupport.h" | 9 #include "core/layout/svg/SVGLayoutSupport.h" |
10 #include "core/layout/svg/SVGResources.h" | 10 #include "core/layout/svg/SVGResources.h" |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 | 123 |
124 { | 124 { |
125 AffineTransform contentTransform; | 125 AffineTransform contentTransform; |
126 if (m_clip.clipPathUnits() == SVGUnitTypes::kSvgUnitTypeObjectboundi
ngbox) { | 126 if (m_clip.clipPathUnits() == SVGUnitTypes::kSvgUnitTypeObjectboundi
ngbox) { |
127 contentTransform.translate(targetBoundingBox.x(), targetBounding
Box.y()); | 127 contentTransform.translate(targetBoundingBox.x(), targetBounding
Box.y()); |
128 contentTransform.scaleNonUniform(targetBoundingBox.width(), targ
etBoundingBox.height()); | 128 contentTransform.scaleNonUniform(targetBoundingBox.width(), targ
etBoundingBox.height()); |
129 } | 129 } |
130 SubtreeContentTransformScope contentTransformScope(contentTransform)
; | 130 SubtreeContentTransformScope contentTransformScope(contentTransform)
; |
131 | 131 |
132 TransformRecorder contentTransformRecorder(maskContext, layoutObject
, contentTransform); | 132 TransformRecorder contentTransformRecorder(maskContext, layoutObject
, contentTransform); |
133 RefPtr<const SkPicture> clipContentPicture = m_clip.createContentPic
ture(); | 133 maskContext.getPaintController().createAndAppend<DrawingDisplayItem>
(layoutObject, DisplayItem::kSVGClip, m_clip.createContentPicture()); |
134 maskContext.getPaintController().createAndAppend<DrawingDisplayItem>
(layoutObject, DisplayItem::kSVGClip, clipContentPicture.get()); | |
135 } | 134 } |
136 | 135 |
137 if (clipPathClipper) | 136 if (clipPathClipper) |
138 SVGClipPainter(*clipPathClipper).finishEffect(m_clip, maskContext, c
lipPathClipperState); | 137 SVGClipPainter(*clipPathClipper).finishEffect(m_clip, maskContext, c
lipPathClipperState); |
139 } | 138 } |
140 | 139 |
141 LayoutObjectDrawingRecorder drawingRecorder(context, layoutObject, DisplayIt
em::kSVGClip, targetPaintInvalidationRect); | 140 LayoutObjectDrawingRecorder drawingRecorder(context, layoutObject, DisplayIt
em::kSVGClip, targetPaintInvalidationRect); |
142 RefPtr<SkPicture> maskPicture = maskPictureBuilder.endRecording(); | 141 sk_sp<SkPicture> maskPicture = maskPictureBuilder.endRecording(); |
143 context.drawPicture(maskPicture.get()); | 142 context.drawPicture(maskPicture.get()); |
144 return true; | 143 return true; |
145 } | 144 } |
146 | 145 |
147 } // namespace blink | 146 } // namespace blink |
OLD | NEW |