OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |