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

Side by Side Diff: Source/core/rendering/svg/RenderSVGResourceClipper.cpp

Issue 18053005: Introduce SVGGraphicsElement IDL interface (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 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 | Annotate | Revision Log
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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 // visible shape, the additive clipping may not work, caused by the clipRule . EvenOdd 93 // visible shape, the additive clipping may not work, caused by the clipRule . EvenOdd
94 // as well as NonZero can cause self-clipping of the elements. 94 // as well as NonZero can cause self-clipping of the elements.
95 // See also http://www.w3.org/TR/SVG/painting.html#FillRuleProperty 95 // See also http://www.w3.org/TR/SVG/painting.html#FillRuleProperty
96 for (Node* childNode = node()->firstChild(); childNode; childNode = childNod e->nextSibling()) { 96 for (Node* childNode = node()->firstChild(); childNode; childNode = childNod e->nextSibling()) {
97 RenderObject* renderer = childNode->renderer(); 97 RenderObject* renderer = childNode->renderer();
98 if (!renderer) 98 if (!renderer)
99 continue; 99 continue;
100 // Only shapes or paths are supported for direct clipping. We need to fa llback to masking for texts. 100 // Only shapes or paths are supported for direct clipping. We need to fa llback to masking for texts.
101 if (renderer->isSVGText()) 101 if (renderer->isSVGText())
102 return false; 102 return false;
103 if (!childNode->isSVGElement() || !toSVGElement(childNode)->isStyledTran sformable()) 103 if (!childNode->isSVGElement() || !toSVGElement(childNode)->isSVGGraphic sElement())
104 continue; 104 continue;
105 SVGStyledTransformableElement* styled = toSVGStyledTransformableElement( childNode); 105 SVGGraphicsElement* styled = toSVGGraphicsElement(childNode);
106 RenderStyle* style = renderer->style(); 106 RenderStyle* style = renderer->style();
107 if (!style || style->display() == NONE || style->visibility() != VISIBLE ) 107 if (!style || style->display() == NONE || style->visibility() != VISIBLE )
108 continue; 108 continue;
109 const SVGRenderStyle* svgStyle = style->svgStyle(); 109 const SVGRenderStyle* svgStyle = style->svgStyle();
110 // Current shape in clip-path gets clipped too. Fallback to masking. 110 // Current shape in clip-path gets clipped too. Fallback to masking.
111 if (!svgStyle->clipperResource().isEmpty()) 111 if (!svgStyle->clipperResource().isEmpty())
112 return false; 112 return false;
113 // Fallback to masking, if there is more than one clipping path. 113 // Fallback to masking, if there is more than one clipping path.
114 if (clipPath.isEmpty()) { 114 if (clipPath.isEmpty()) {
115 styled->toClipPath(clipPath); 115 styled->toClipPath(clipPath);
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 AffineTransform transform; 316 AffineTransform transform;
317 transform.translate(objectBoundingBox.x(), objectBoundingBox.y()); 317 transform.translate(objectBoundingBox.x(), objectBoundingBox.y());
318 transform.scaleNonUniform(objectBoundingBox.width(), objectBoundingBox.h eight()); 318 transform.scaleNonUniform(objectBoundingBox.width(), objectBoundingBox.h eight());
319 return transform.mapRect(m_clipBoundaries); 319 return transform.mapRect(m_clipBoundaries);
320 } 320 }
321 321
322 return m_clipBoundaries; 322 return m_clipBoundaries;
323 } 323 }
324 324
325 } 325 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698