Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/ClipPathClipper.h" | 5 #include "core/paint/ClipPathClipper.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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 205 contentTransform); | 205 contentTransform); |
| 206 maskContext.getPaintController().createAndAppend<DrawingDisplayItem>( | 206 maskContext.getPaintController().createAndAppend<DrawingDisplayItem>( |
| 207 m_layoutObject, DisplayItem::kSVGClip, | 207 m_layoutObject, DisplayItem::kSVGClip, |
| 208 m_resourceClipper->createPaintRecord()); | 208 m_resourceClipper->createPaintRecord()); |
| 209 } | 209 } |
| 210 } | 210 } |
| 211 | 211 |
| 212 LayoutObjectDrawingRecorder drawingRecorder( | 212 LayoutObjectDrawingRecorder drawingRecorder( |
| 213 m_context, m_layoutObject, DisplayItem::kSVGClip, targetVisualRect); | 213 m_context, m_layoutObject, DisplayItem::kSVGClip, targetVisualRect); |
| 214 sk_sp<PaintRecord> maskPaintRecord = maskBuilder.endRecording(); | 214 sk_sp<PaintRecord> maskPaintRecord = maskBuilder.endRecording(); |
| 215 m_context.drawRecord(maskPaintRecord.get()); | 215 m_context.drawRecord(maskPaintRecord); |
|
danakj
2017/03/16 20:06:15
move(), or just pass endRecording() directly
| |
| 216 return true; | 216 return true; |
| 217 } | 217 } |
| 218 | 218 |
| 219 void ClipPathClipper::finishEffect() { | 219 void ClipPathClipper::finishEffect() { |
| 220 switch (m_clipperState) { | 220 switch (m_clipperState) { |
| 221 case ClipperState::AppliedPath: | 221 case ClipperState::AppliedPath: |
| 222 // Path-only clipping, no layers to restore but we need to emit an end to | 222 // Path-only clipping, no layers to restore but we need to emit an end to |
| 223 // the clip path display item. | 223 // the clip path display item. |
| 224 m_context.getPaintController().endItem<EndClipPathDisplayItem>( | 224 m_context.getPaintController().endItem<EndClipPathDisplayItem>( |
| 225 m_layoutObject); | 225 m_layoutObject); |
| 226 break; | 226 break; |
| 227 case ClipperState::AppliedMask: | 227 case ClipperState::AppliedMask: |
| 228 // Transfer content -> clip mask (SrcIn) | 228 // Transfer content -> clip mask (SrcIn) |
| 229 m_maskContentRecorder.reset(); | 229 m_maskContentRecorder.reset(); |
| 230 | 230 |
| 231 // Transfer clip mask -> bg (SrcOver) | 231 // Transfer clip mask -> bg (SrcOver) |
| 232 m_maskClipRecorder.reset(); | 232 m_maskClipRecorder.reset(); |
| 233 break; | 233 break; |
| 234 case ClipperState::NotApplied: | 234 case ClipperState::NotApplied: |
| 235 NOTREACHED(); | 235 NOTREACHED(); |
| 236 break; | 236 break; |
| 237 } | 237 } |
| 238 } | 238 } |
| 239 | 239 |
| 240 } // namespace blink | 240 } // namespace blink |
| OLD | NEW |