| OLD | NEW |
| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 { | 42 { |
| 43 } | 43 } |
| 44 | 44 |
| 45 LayoutSVGResourceClipper::~LayoutSVGResourceClipper() | 45 LayoutSVGResourceClipper::~LayoutSVGResourceClipper() |
| 46 { | 46 { |
| 47 } | 47 } |
| 48 | 48 |
| 49 void LayoutSVGResourceClipper::removeAllClientsFromCache(bool markForInvalidatio
n) | 49 void LayoutSVGResourceClipper::removeAllClientsFromCache(bool markForInvalidatio
n) |
| 50 { | 50 { |
| 51 m_clipContentPath.clear(); | 51 m_clipContentPath.clear(); |
| 52 m_clipContentPicture.clear(); | 52 m_clipContentPicture.reset(); |
| 53 m_localClipBounds = FloatRect(); | 53 m_localClipBounds = FloatRect(); |
| 54 markAllClientsForInvalidation(markForInvalidation ? LayoutAndBoundariesInval
idation : ParentOnlyInvalidation); | 54 markAllClientsForInvalidation(markForInvalidation ? LayoutAndBoundariesInval
idation : ParentOnlyInvalidation); |
| 55 } | 55 } |
| 56 | 56 |
| 57 void LayoutSVGResourceClipper::removeClientFromCache(LayoutObject* client, bool
markForInvalidation) | 57 void LayoutSVGResourceClipper::removeClientFromCache(LayoutObject* client, bool
markForInvalidation) |
| 58 { | 58 { |
| 59 ASSERT(client); | 59 ASSERT(client); |
| 60 markClientForInvalidation(client, markForInvalidation ? BoundariesInvalidati
on : ParentOnlyInvalidation); | 60 markClientForInvalidation(client, markForInvalidation ? BoundariesInvalidati
on : ParentOnlyInvalidation); |
| 61 } | 61 } |
| 62 | 62 |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 transform.translate(referenceBox.x(), referenceBox.y()); | 151 transform.translate(referenceBox.x(), referenceBox.y()); |
| 152 transform.scaleNonUniform(referenceBox.width(), referenceBox.height()); | 152 transform.scaleNonUniform(referenceBox.width(), referenceBox.height()); |
| 153 clipPath.transform(transform); | 153 clipPath.transform(transform); |
| 154 } | 154 } |
| 155 | 155 |
| 156 // Transform path by animatedLocalTransform. | 156 // Transform path by animatedLocalTransform. |
| 157 clipPath.transform(animatedLocalTransform); | 157 clipPath.transform(animatedLocalTransform); |
| 158 return true; | 158 return true; |
| 159 } | 159 } |
| 160 | 160 |
| 161 PassRefPtr<const SkPicture> LayoutSVGResourceClipper::createContentPicture() | 161 sk_sp<const SkPicture> LayoutSVGResourceClipper::createContentPicture() |
| 162 { | 162 { |
| 163 ASSERT(frame()); | 163 ASSERT(frame()); |
| 164 if (m_clipContentPicture) | 164 if (m_clipContentPicture) |
| 165 return m_clipContentPicture; | 165 return m_clipContentPicture; |
| 166 | 166 |
| 167 // Using strokeBoundingBox (instead of paintInvalidationRectInLocalSVGCoordi
nates) to avoid the intersection | 167 // Using strokeBoundingBox (instead of paintInvalidationRectInLocalSVGCoordi
nates) to avoid the intersection |
| 168 // with local clips/mask, which may yield incorrect results when mixing obje
ctBoundingBox and | 168 // with local clips/mask, which may yield incorrect results when mixing obje
ctBoundingBox and |
| 169 // userSpaceOnUse units (http://crbug.com/294900). | 169 // userSpaceOnUse units (http://crbug.com/294900). |
| 170 FloatRect bounds = strokeBoundingBox(); | 170 FloatRect bounds = strokeBoundingBox(); |
| 171 | 171 |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 | 275 |
| 276 AffineTransform transform = toSVGClipPathElement(element())->calculateAnimat
edLocalTransform(); | 276 AffineTransform transform = toSVGClipPathElement(element())->calculateAnimat
edLocalTransform(); |
| 277 if (clipPathUnits() == SVGUnitTypes::kSvgUnitTypeObjectboundingbox) { | 277 if (clipPathUnits() == SVGUnitTypes::kSvgUnitTypeObjectboundingbox) { |
| 278 transform.translate(referenceBox.x(), referenceBox.y()); | 278 transform.translate(referenceBox.x(), referenceBox.y()); |
| 279 transform.scaleNonUniform(referenceBox.width(), referenceBox.height()); | 279 transform.scaleNonUniform(referenceBox.width(), referenceBox.height()); |
| 280 } | 280 } |
| 281 return transform.mapRect(m_localClipBounds); | 281 return transform.mapRect(m_localClipBounds); |
| 282 } | 282 } |
| 283 | 283 |
| 284 } // namespace blink | 284 } // namespace blink |
| OLD | NEW |