Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(107)

Side by Side Diff: third_party/WebKit/Source/core/paint/ClipPathClipper.cpp

Issue 2743363006: Clean up cc/paint interfaces (Closed)
Patch Set: Fix PaintControllerTest v2 Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 TransformRecorder contentTransformRecorder(maskContext, m_layoutObject, 204 TransformRecorder contentTransformRecorder(maskContext, m_layoutObject,
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 m_context.drawRecord(maskBuilder.endRecording());
215 m_context.drawRecord(maskPaintRecord.get());
216 return true; 215 return true;
217 } 216 }
218 217
219 void ClipPathClipper::finishEffect() { 218 void ClipPathClipper::finishEffect() {
220 switch (m_clipperState) { 219 switch (m_clipperState) {
221 case ClipperState::AppliedPath: 220 case ClipperState::AppliedPath:
222 // Path-only clipping, no layers to restore but we need to emit an end to 221 // Path-only clipping, no layers to restore but we need to emit an end to
223 // the clip path display item. 222 // the clip path display item.
224 m_context.getPaintController().endItem<EndClipPathDisplayItem>( 223 m_context.getPaintController().endItem<EndClipPathDisplayItem>(
225 m_layoutObject); 224 m_layoutObject);
226 break; 225 break;
227 case ClipperState::AppliedMask: 226 case ClipperState::AppliedMask:
228 // Transfer content -> clip mask (SrcIn) 227 // Transfer content -> clip mask (SrcIn)
229 m_maskContentRecorder.reset(); 228 m_maskContentRecorder.reset();
230 229
231 // Transfer clip mask -> bg (SrcOver) 230 // Transfer clip mask -> bg (SrcOver)
232 m_maskClipRecorder.reset(); 231 m_maskClipRecorder.reset();
233 break; 232 break;
234 case ClipperState::NotApplied: 233 case ClipperState::NotApplied:
235 NOTREACHED(); 234 NOTREACHED();
236 break; 235 break;
237 } 236 }
238 } 237 }
239 238
240 } // namespace blink 239 } // namespace blink
OLDNEW
« no previous file with comments | « media/renderers/skcanvas_video_renderer.cc ('k') | third_party/WebKit/Source/core/paint/SVGMaskPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698