| 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 toSVGGeometryElement(childElement)->toClipPath(m_clipContentPath
); | 101 toSVGGeometryElement(childElement)->toClipPath(m_clipContentPath
); |
| 102 else if (isSVGUseElement(childElement)) | 102 else if (isSVGUseElement(childElement)) |
| 103 toSVGUseElement(childElement)->toClipPath(m_clipContentPath); | 103 toSVGUseElement(childElement)->toClipPath(m_clipContentPath); |
| 104 | 104 |
| 105 continue; | 105 continue; |
| 106 } | 106 } |
| 107 | 107 |
| 108 // Multiple shapes require PathOps. In some degenerate cases PathOps can
exhibit quadratic | 108 // Multiple shapes require PathOps. In some degenerate cases PathOps can
exhibit quadratic |
| 109 // behavior, so we cap the number of ops to a reasonable count. | 109 // behavior, so we cap the number of ops to a reasonable count. |
| 110 const unsigned kMaxOps = 42; | 110 const unsigned kMaxOps = 42; |
| 111 if (!RuntimeEnabledFeatures::pathOpsSVGClippingEnabled() || ++opCount >
kMaxOps) { | 111 if (++opCount > kMaxOps) { |
| 112 m_clipContentPath.clear(); | 112 m_clipContentPath.clear(); |
| 113 return false; | 113 return false; |
| 114 } | 114 } |
| 115 | 115 |
| 116 // Second clip shape => start using the builder. | 116 // Second clip shape => start using the builder. |
| 117 if (!usingBuilder) { | 117 if (!usingBuilder) { |
| 118 clipPathBuilder.add(m_clipContentPath.getSkPath(), kUnion_SkPathOp); | 118 clipPathBuilder.add(m_clipContentPath.getSkPath(), kUnion_SkPathOp); |
| 119 usingBuilder = true; | 119 usingBuilder = true; |
| 120 } | 120 } |
| 121 | 121 |
| (...skipping 153 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 |