| 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 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 #include "core/SVGNames.h" | 25 #include "core/SVGNames.h" |
| 26 #include "core/dom/ElementTraversal.h" | 26 #include "core/dom/ElementTraversal.h" |
| 27 #include "core/layout/HitTestResult.h" | 27 #include "core/layout/HitTestResult.h" |
| 28 #include "core/layout/svg/SVGLayoutSupport.h" | 28 #include "core/layout/svg/SVGLayoutSupport.h" |
| 29 #include "core/paint/PaintInfo.h" | 29 #include "core/paint/PaintInfo.h" |
| 30 #include "core/svg/SVGGeometryElement.h" | 30 #include "core/svg/SVGGeometryElement.h" |
| 31 #include "core/svg/SVGUseElement.h" | 31 #include "core/svg/SVGUseElement.h" |
| 32 #include "platform/RuntimeEnabledFeatures.h" | 32 #include "platform/RuntimeEnabledFeatures.h" |
| 33 #include "platform/graphics/paint/SkPictureBuilder.h" | 33 #include "platform/graphics/paint/SkPictureBuilder.h" |
| 34 #include "third_party/skia/include/core/SkPicture.h" | 34 #include "skia/ext/cdl_picture.h" |
| 35 #include "third_party/skia/include/pathops/SkPathOps.h" | 35 #include "third_party/skia/include/pathops/SkPathOps.h" |
| 36 | 36 |
| 37 namespace blink { | 37 namespace blink { |
| 38 | 38 |
| 39 LayoutSVGResourceClipper::LayoutSVGResourceClipper(SVGClipPathElement* node) | 39 LayoutSVGResourceClipper::LayoutSVGResourceClipper(SVGClipPathElement* node) |
| 40 : LayoutSVGResourceContainer(node), m_inClipExpansion(false) {} | 40 : LayoutSVGResourceContainer(node), m_inClipExpansion(false) {} |
| 41 | 41 |
| 42 LayoutSVGResourceClipper::~LayoutSVGResourceClipper() {} | 42 LayoutSVGResourceClipper::~LayoutSVGResourceClipper() {} |
| 43 | 43 |
| 44 void LayoutSVGResourceClipper::removeAllClientsFromCache( | 44 void LayoutSVGResourceClipper::removeAllClientsFromCache( |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 transform.translate(referenceBox.x(), referenceBox.y()); | 158 transform.translate(referenceBox.x(), referenceBox.y()); |
| 159 transform.scaleNonUniform(referenceBox.width(), referenceBox.height()); | 159 transform.scaleNonUniform(referenceBox.width(), referenceBox.height()); |
| 160 clipPath.transform(transform); | 160 clipPath.transform(transform); |
| 161 } | 161 } |
| 162 | 162 |
| 163 // Transform path by animatedLocalTransform. | 163 // Transform path by animatedLocalTransform. |
| 164 clipPath.transform(animatedLocalTransform); | 164 clipPath.transform(animatedLocalTransform); |
| 165 return true; | 165 return true; |
| 166 } | 166 } |
| 167 | 167 |
| 168 sk_sp<const SkPicture> LayoutSVGResourceClipper::createContentPicture() { | 168 sk_sp<const CdlPicture> LayoutSVGResourceClipper::createContentPicture() { |
| 169 ASSERT(frame()); | 169 ASSERT(frame()); |
| 170 if (m_clipContentPicture) | 170 if (m_clipContentPicture) |
| 171 return m_clipContentPicture; | 171 return m_clipContentPicture; |
| 172 | 172 |
| 173 // Using strokeBoundingBox (instead of visualRectInLocalSVGCoordinates) to | 173 // Using strokeBoundingBox (instead of visualRectInLocalSVGCoordinates) to |
| 174 // avoid the intersection with local clips/mask, which may yield incorrect | 174 // avoid the intersection with local clips/mask, which may yield incorrect |
| 175 // results when mixing objectBoundingBox and userSpaceOnUse units | 175 // results when mixing objectBoundingBox and userSpaceOnUse units |
| 176 // (http://crbug.com/294900). | 176 // (http://crbug.com/294900). |
| 177 FloatRect bounds = strokeBoundingBox(); | 177 FloatRect bounds = strokeBoundingBox(); |
| 178 | 178 |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 toSVGClipPathElement(element())->calculateTransform( | 308 toSVGClipPathElement(element())->calculateTransform( |
| 309 SVGElement::IncludeMotionTransform); | 309 SVGElement::IncludeMotionTransform); |
| 310 if (clipPathUnits() == SVGUnitTypes::kSvgUnitTypeObjectboundingbox) { | 310 if (clipPathUnits() == SVGUnitTypes::kSvgUnitTypeObjectboundingbox) { |
| 311 transform.translate(referenceBox.x(), referenceBox.y()); | 311 transform.translate(referenceBox.x(), referenceBox.y()); |
| 312 transform.scaleNonUniform(referenceBox.width(), referenceBox.height()); | 312 transform.scaleNonUniform(referenceBox.width(), referenceBox.height()); |
| 313 } | 313 } |
| 314 return transform.mapRect(m_localClipBounds); | 314 return transform.mapRect(m_localClipBounds); |
| 315 } | 315 } |
| 316 | 316 |
| 317 } // namespace blink | 317 } // namespace blink |
| OLD | NEW |