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

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

Issue 2555483003: Don't fail clip-paths with empty bounds (Closed)
Patch Set: Add SPv2 expectation Created 4 years 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
« no previous file with comments | « third_party/WebKit/LayoutTests/svg/clip-path/nested-empty-clip-expected.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 30 matching lines...) Expand all
41 const FloatRect& targetBoundingBox, 41 const FloatRect& targetBoundingBox,
42 const FloatRect& visualRect, 42 const FloatRect& visualRect,
43 const FloatPoint& layerPositionOffset, 43 const FloatPoint& layerPositionOffset,
44 GraphicsContext& context, 44 GraphicsContext& context,
45 ClipperState& clipperState) { 45 ClipperState& clipperState) {
46 DCHECK_EQ(clipperState, ClipperState::NotApplied); 46 DCHECK_EQ(clipperState, ClipperState::NotApplied);
47 SECURITY_DCHECK(!m_clip.needsLayout()); 47 SECURITY_DCHECK(!m_clip.needsLayout());
48 48
49 m_clip.clearInvalidationMask(); 49 m_clip.clearInvalidationMask();
50 50
51 if (visualRect.isEmpty() || m_clip.hasCycle()) 51 if (m_clip.hasCycle())
52 return false; 52 return false;
53 53
54 SVGClipExpansionCycleHelper inClipExpansionChange(m_clip); 54 SVGClipExpansionCycleHelper inClipExpansionChange(m_clip);
55 55
56 AffineTransform animatedLocalTransform = 56 AffineTransform animatedLocalTransform =
57 toSVGClipPathElement(m_clip.element()) 57 toSVGClipPathElement(m_clip.element())
58 ->calculateTransform(SVGElement::IncludeMotionTransform); 58 ->calculateTransform(SVGElement::IncludeMotionTransform);
59 // When drawing a clip for non-SVG elements, the CTM does not include the zoom 59 // When drawing a clip for non-SVG elements, the CTM does not include the zoom
60 // factor. In this case, we need to apply the zoom scale explicitly - but 60 // factor. In this case, we need to apply the zoom scale explicitly - but
61 // only for clips with userSpaceOnUse units (the zoom is accounted for 61 // only for clips with userSpaceOnUse units (the zoom is accounted for
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 } 162 }
163 163
164 LayoutObjectDrawingRecorder drawingRecorder( 164 LayoutObjectDrawingRecorder drawingRecorder(
165 context, layoutObject, DisplayItem::kSVGClip, targetVisualRect); 165 context, layoutObject, DisplayItem::kSVGClip, targetVisualRect);
166 sk_sp<SkPicture> maskPicture = maskPictureBuilder.endRecording(); 166 sk_sp<SkPicture> maskPicture = maskPictureBuilder.endRecording();
167 context.drawPicture(maskPicture.get()); 167 context.drawPicture(maskPicture.get());
168 return true; 168 return true;
169 } 169 }
170 170
171 } // namespace blink 171 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/svg/clip-path/nested-empty-clip-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698