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

Side by Side Diff: third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceClipper.cpp

Issue 2648343004: Don't paint selections in <mask>s, <clipPath>s and <pattern>s (Closed)
Patch Set: Rebase Created 3 years, 10 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 /* 1 /*
2 * Copyright (C) 2004, 2005, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Rob Buis <buis@kde.org>
4 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. 4 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved.
5 * Copyright (C) 2011 Dirk Schulze <krit@webkit.org> 5 * Copyright (C) 2011 Dirk Schulze <krit@webkit.org>
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 217
218 SkPictureBuilder pictureBuilder(bounds, nullptr, nullptr); 218 SkPictureBuilder pictureBuilder(bounds, nullptr, nullptr);
219 // Switch to a paint behavior where all children of this <clipPath> will be 219 // Switch to a paint behavior where all children of this <clipPath> will be
220 // laid out using special constraints: 220 // laid out using special constraints:
221 // - fill-opacity/stroke-opacity/opacity set to 1 221 // - fill-opacity/stroke-opacity/opacity set to 1
222 // - masker/filter not applied when laying out the children 222 // - masker/filter not applied when laying out the children
223 // - fill is set to the initial fill paint server (solid, black) 223 // - fill is set to the initial fill paint server (solid, black)
224 // - stroke is set to the initial stroke paint server (none) 224 // - stroke is set to the initial stroke paint server (none)
225 PaintInfo info(pictureBuilder.context(), LayoutRect::infiniteIntRect(), 225 PaintInfo info(pictureBuilder.context(), LayoutRect::infiniteIntRect(),
226 PaintPhaseForeground, GlobalPaintNormalPhase, 226 PaintPhaseForeground, GlobalPaintNormalPhase,
227 PaintLayerPaintingRenderingClipPathAsMask); 227 PaintLayerPaintingRenderingClipPathAsMask |
228 PaintLayerPaintingRenderingResourceSubtree);
228 229
229 for (const SVGElement& childElement : 230 for (const SVGElement& childElement :
230 Traversal<SVGElement>::childrenOf(*element())) { 231 Traversal<SVGElement>::childrenOf(*element())) {
231 if (!contributesToClip(childElement)) 232 if (!contributesToClip(childElement))
232 continue; 233 continue;
233 // Use the LayoutObject of the direct child even if it is a <use>. In that 234 // Use the LayoutObject of the direct child even if it is a <use>. In that
234 // case, we will paint the targeted element indirectly. 235 // case, we will paint the targeted element indirectly.
235 const LayoutObject* layoutObject = childElement.layoutObject(); 236 const LayoutObject* layoutObject = childElement.layoutObject();
236 layoutObject->paint(info, IntPoint()); 237 layoutObject->paint(info, IntPoint());
237 } 238 }
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 toSVGClipPathElement(element())->calculateTransform( 303 toSVGClipPathElement(element())->calculateTransform(
303 SVGElement::IncludeMotionTransform); 304 SVGElement::IncludeMotionTransform);
304 if (clipPathUnits() == SVGUnitTypes::kSvgUnitTypeObjectboundingbox) { 305 if (clipPathUnits() == SVGUnitTypes::kSvgUnitTypeObjectboundingbox) {
305 transform.translate(referenceBox.x(), referenceBox.y()); 306 transform.translate(referenceBox.x(), referenceBox.y());
306 transform.scaleNonUniform(referenceBox.width(), referenceBox.height()); 307 transform.scaleNonUniform(referenceBox.width(), referenceBox.height());
307 } 308 }
308 return transform.mapRect(m_localClipBounds); 309 return transform.mapRect(m_localClipBounds);
309 } 310 }
310 311
311 } // namespace blink 312 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698