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

Side by Side Diff: third_party/WebKit/Source/core/layout/svg/SVGLayoutSupport.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
« no previous file with comments | « third_party/WebKit/Source/core/layout/svg/SVGLayoutSupport.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008 Rob Buis <buis@kde.org> 2 * Copyright (C) 2007, 2008 Rob Buis <buis@kde.org>
3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> 3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org>
4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> 4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org>
5 * Copyright (C) 2009 Google, Inc. All rights reserved. 5 * Copyright (C) 2009 Google, Inc. All rights reserved.
6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> 6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
7 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. 7 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 if (LayoutSVGResourceMasker* masker = resources->masker()) 361 if (LayoutSVGResourceMasker* masker = resources->masker())
362 paintInvalidationRect.intersect(masker->resourceBoundingBox(layoutObject )); 362 paintInvalidationRect.intersect(masker->resourceBoundingBox(layoutObject ));
363 } 363 }
364 364
365 bool SVGLayoutSupport::hasFilterResource(const LayoutObject& object) 365 bool SVGLayoutSupport::hasFilterResource(const LayoutObject& object)
366 { 366 {
367 SVGResources* resources = SVGResourcesCache::cachedResourcesForLayoutObject( &object); 367 SVGResources* resources = SVGResourcesCache::cachedResourcesForLayoutObject( &object);
368 return resources && resources->filter(); 368 return resources && resources->filter();
369 } 369 }
370 370
371 bool SVGLayoutSupport::pointInClippingArea(const LayoutObject* object, const Flo atPoint& point) 371 bool SVGLayoutSupport::pointInClippingArea(const LayoutObject& object, const Flo atPoint& point)
372 { 372 {
373 ASSERT(object);
374
375 // We just take clippers into account to determine if a point is on the node . The Specification may 373 // We just take clippers into account to determine if a point is on the node . The Specification may
376 // change later and we also need to check maskers. 374 // change later and we also need to check maskers.
377 SVGResources* resources = SVGResourcesCache::cachedResourcesForLayoutObject( object); 375 SVGResources* resources = SVGResourcesCache::cachedResourcesForLayoutObject( &object);
378 if (!resources) 376 if (!resources)
379 return true; 377 return true;
380 378
381 if (LayoutSVGResourceClipper* clipper = resources->clipper()) 379 if (LayoutSVGResourceClipper* clipper = resources->clipper())
382 return clipper->hitTestClipContent(object->objectBoundingBox(), point); 380 return clipper->hitTestClipContent(object.objectBoundingBox(), point);
383 381
384 return true; 382 return true;
385 } 383 }
386 384
387 bool SVGLayoutSupport::transformToUserSpaceAndCheckClipping(const LayoutObject* object, const AffineTransform& localTransform, const FloatPoint& pointInParent, FloatPoint& localPoint) 385 bool SVGLayoutSupport::transformToUserSpaceAndCheckClipping(const LayoutObject& object, const AffineTransform& localTransform, const FloatPoint& pointInParent, FloatPoint& localPoint)
388 { 386 {
389 if (!localTransform.isInvertible()) 387 if (!localTransform.isInvertible())
390 return false; 388 return false;
391 localPoint = localTransform.inverse().mapPoint(pointInParent); 389 localPoint = localTransform.inverse().mapPoint(pointInParent);
392 return pointInClippingArea(object, localPoint); 390 return pointInClippingArea(object, localPoint);
393 } 391 }
394 392
395 DashArray SVGLayoutSupport::resolveSVGDashArray(const SVGDashArray& svgDashArray , const ComputedStyle& style, const SVGLengthContext& lengthContext) 393 DashArray SVGLayoutSupport::resolveSVGDashArray(const SVGDashArray& svgDashArray , const ComputedStyle& style, const SVGLengthContext& lengthContext)
396 { 394 {
397 DashArray dashArray; 395 DashArray dashArray;
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 574
577 return closestText; 575 return closestText;
578 } 576 }
579 577
580 LayoutObject* SVGLayoutSupport::findClosestLayoutSVGText(LayoutObject* layoutObj ect, const FloatPoint& point) 578 LayoutObject* SVGLayoutSupport::findClosestLayoutSVGText(LayoutObject* layoutObj ect, const FloatPoint& point)
581 { 579 {
582 return searchTreeForFindClosestLayoutSVGText(layoutObject, point).candidateL ayoutObject; 580 return searchTreeForFindClosestLayoutSVGText(layoutObject, point).candidateL ayoutObject;
583 } 581 }
584 582
585 } // namespace blink 583 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/svg/SVGLayoutSupport.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698