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

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

Issue 2478233002: Make 'transform' a presentation attribute on SVG elements (Closed)
Patch Set: Rebase 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
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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 (visualRect.isEmpty() || 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())->calculateAnimatedLocalTransform(); 57 toSVGClipPathElement(m_clip.element())
58 ->calculateTransform(SVGElement::IncludeMotionTransform);
58 // 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
59 // 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
60 // only for clips with userSpaceOnUse units (the zoom is accounted for 61 // only for clips with userSpaceOnUse units (the zoom is accounted for
61 // objectBoundingBox-resolved lengths). 62 // objectBoundingBox-resolved lengths).
62 if (!target.isSVG() && 63 if (!target.isSVG() &&
63 m_clip.clipPathUnits() == SVGUnitTypes::kSvgUnitTypeUserspaceonuse) { 64 m_clip.clipPathUnits() == SVGUnitTypes::kSvgUnitTypeUserspaceonuse) {
64 DCHECK(m_clip.style()); 65 DCHECK(m_clip.style());
65 animatedLocalTransform.scale(m_clip.style()->effectiveZoom()); 66 animatedLocalTransform.scale(m_clip.style()->effectiveZoom());
66 } 67 }
67 68
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 } 162 }
162 163
163 LayoutObjectDrawingRecorder drawingRecorder( 164 LayoutObjectDrawingRecorder drawingRecorder(
164 context, layoutObject, DisplayItem::kSVGClip, targetVisualRect); 165 context, layoutObject, DisplayItem::kSVGClip, targetVisualRect);
165 sk_sp<SkPicture> maskPicture = maskPictureBuilder.endRecording(); 166 sk_sp<SkPicture> maskPicture = maskPictureBuilder.endRecording();
166 context.drawPicture(maskPicture.get()); 167 context.drawPicture(maskPicture.get());
167 return true; 168 return true;
168 } 169 }
169 170
170 } // namespace blink 171 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698