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

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

Issue 2265113002: More const LayoutObject references in SVGLayoutSupport (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 if (isSVGUseElement(*childElement) && !toSVGUseElement(*childElement).vi sibleTargetGraphicsElementForClipping()) 226 if (isSVGUseElement(*childElement) && !toSVGUseElement(*childElement).vi sibleTargetGraphicsElementForClipping())
227 continue; 227 continue;
228 228
229 m_localClipBounds.unite(layoutObject->localToSVGParentTransform().mapRec t(layoutObject->paintInvalidationRectInLocalSVGCoordinates())); 229 m_localClipBounds.unite(layoutObject->localToSVGParentTransform().mapRec t(layoutObject->paintInvalidationRectInLocalSVGCoordinates()));
230 } 230 }
231 } 231 }
232 232
233 bool LayoutSVGResourceClipper::hitTestClipContent(const FloatRect& objectBoundin gBox, const FloatPoint& nodeAtPoint) 233 bool LayoutSVGResourceClipper::hitTestClipContent(const FloatRect& objectBoundin gBox, const FloatPoint& nodeAtPoint)
234 { 234 {
235 FloatPoint point = nodeAtPoint; 235 FloatPoint point = nodeAtPoint;
236 if (!SVGLayoutSupport::pointInClippingArea(this, point)) 236 if (!SVGLayoutSupport::pointInClippingArea(*this, point))
237 return false; 237 return false;
238 238
239 if (clipPathUnits() == SVGUnitTypes::kSvgUnitTypeObjectboundingbox) { 239 if (clipPathUnits() == SVGUnitTypes::kSvgUnitTypeObjectboundingbox) {
240 AffineTransform transform; 240 AffineTransform transform;
241 transform.translate(objectBoundingBox.x(), objectBoundingBox.y()); 241 transform.translate(objectBoundingBox.x(), objectBoundingBox.y());
242 transform.scaleNonUniform(objectBoundingBox.width(), objectBoundingBox.h eight()); 242 transform.scaleNonUniform(objectBoundingBox.width(), objectBoundingBox.h eight());
243 point = transform.inverse().mapPoint(point); 243 point = transform.inverse().mapPoint(point);
244 } 244 }
245 245
246 AffineTransform animatedLocalTransform = toSVGClipPathElement(element())->ca lculateAnimatedLocalTransform(); 246 AffineTransform animatedLocalTransform = toSVGClipPathElement(element())->ca lculateAnimatedLocalTransform();
(...skipping 30 matching lines...) Expand all
277 if (clipPathUnits() == SVGUnitTypes::kSvgUnitTypeObjectboundingbox) { 277 if (clipPathUnits() == SVGUnitTypes::kSvgUnitTypeObjectboundingbox) {
278 FloatRect objectBoundingBox = object->objectBoundingBox(); 278 FloatRect objectBoundingBox = object->objectBoundingBox();
279 transform.translate(objectBoundingBox.x(), objectBoundingBox.y()); 279 transform.translate(objectBoundingBox.x(), objectBoundingBox.y());
280 transform.scaleNonUniform(objectBoundingBox.width(), objectBoundingBox.h eight()); 280 transform.scaleNonUniform(objectBoundingBox.width(), objectBoundingBox.h eight());
281 } 281 }
282 282
283 return transform.mapRect(m_localClipBounds); 283 return transform.mapRect(m_localClipBounds);
284 } 284 }
285 285
286 } // namespace blink 286 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698