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

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

Issue 19539003: Introduce toSVGUseElement(), use it (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased 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
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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 frame()->view()->setPaintBehavior(oldBehavior); 227 frame()->view()->setPaintBehavior(oldBehavior);
228 return false; 228 return false;
229 } 229 }
230 RenderStyle* style = renderer->style(); 230 RenderStyle* style = renderer->style();
231 if (!style || style->display() == NONE || style->visibility() != VISIBLE ) 231 if (!style || style->display() == NONE || style->visibility() != VISIBLE )
232 continue; 232 continue;
233 233
234 WindRule newClipRule = style->svgStyle()->clipRule(); 234 WindRule newClipRule = style->svgStyle()->clipRule();
235 bool isUseElement = childNode->hasTagName(SVGNames::useTag); 235 bool isUseElement = childNode->hasTagName(SVGNames::useTag);
236 if (isUseElement) { 236 if (isUseElement) {
237 SVGUseElement* useElement = static_cast<SVGUseElement*>(childNode); 237 SVGUseElement* useElement = toSVGUseElement(childNode);
238 renderer = useElement->rendererClipChild(); 238 renderer = useElement->rendererClipChild();
239 if (!renderer) 239 if (!renderer)
240 continue; 240 continue;
241 if (!useElement->hasAttribute(SVGNames::clip_ruleAttr)) 241 if (!useElement->hasAttribute(SVGNames::clip_ruleAttr))
242 newClipRule = renderer->style()->svgStyle()->clipRule(); 242 newClipRule = renderer->style()->svgStyle()->clipRule();
243 } 243 }
244 244
245 // Only shapes, paths and texts are allowed for clipping. 245 // Only shapes, paths and texts are allowed for clipping.
246 if (!renderer->isSVGShape() && !renderer->isSVGText()) 246 if (!renderer->isSVGShape() && !renderer->isSVGText())
247 continue; 247 continue;
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 AffineTransform transform; 320 AffineTransform transform;
321 transform.translate(objectBoundingBox.x(), objectBoundingBox.y()); 321 transform.translate(objectBoundingBox.x(), objectBoundingBox.y());
322 transform.scaleNonUniform(objectBoundingBox.width(), objectBoundingBox.h eight()); 322 transform.scaleNonUniform(objectBoundingBox.width(), objectBoundingBox.h eight());
323 return transform.mapRect(m_clipBoundaries); 323 return transform.mapRect(m_clipBoundaries);
324 } 324 }
325 325
326 return m_clipBoundaries; 326 return m_clipBoundaries;
327 } 327 }
328 328
329 } 329 }
OLDNEW
« no previous file with comments | « Source/core/page/EventHandler.cpp ('k') | Source/core/rendering/svg/RenderSVGTransformableContainer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698