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 97 matching lines...) Loading... |
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 (!RuntimeEnabledFeatures::pathOpsSVGClippingEnabled() || ++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.skPath(), kUnion_SkPathOp); | 118 clipPathBuilder.add(m_clipContentPath.getSkPath(), kUnion_SkPathOp); |
119 usingBuilder = true; | 119 usingBuilder = true; |
120 } | 120 } |
121 | 121 |
122 Path subPath; | 122 Path subPath; |
123 if (isSVGGeometryElement(childElement)) | 123 if (isSVGGeometryElement(childElement)) |
124 toSVGGeometryElement(childElement)->toClipPath(subPath); | 124 toSVGGeometryElement(childElement)->toClipPath(subPath); |
125 else if (isSVGUseElement(childElement)) | 125 else if (isSVGUseElement(childElement)) |
126 toSVGUseElement(childElement)->toClipPath(subPath); | 126 toSVGUseElement(childElement)->toClipPath(subPath); |
127 | 127 |
128 clipPathBuilder.add(subPath.skPath(), kUnion_SkPathOp); | 128 clipPathBuilder.add(subPath.getSkPath(), kUnion_SkPathOp); |
129 } | 129 } |
130 | 130 |
131 if (usingBuilder) { | 131 if (usingBuilder) { |
132 SkPath resolvedPath; | 132 SkPath resolvedPath; |
133 clipPathBuilder.resolve(&resolvedPath); | 133 clipPathBuilder.resolve(&resolvedPath); |
134 m_clipContentPath = resolvedPath; | 134 m_clipContentPath = resolvedPath; |
135 } | 135 } |
136 | 136 |
137 return true; | 137 return true; |
138 } | 138 } |
(...skipping 146 matching lines...) Loading... |
285 AffineTransform transform; | 285 AffineTransform transform; |
286 transform.translate(objectBoundingBox.x(), objectBoundingBox.y()); | 286 transform.translate(objectBoundingBox.x(), objectBoundingBox.y()); |
287 transform.scaleNonUniform(objectBoundingBox.width(), objectBoundingBox.h
eight()); | 287 transform.scaleNonUniform(objectBoundingBox.width(), objectBoundingBox.h
eight()); |
288 return transform.mapRect(m_clipBoundaries); | 288 return transform.mapRect(m_clipBoundaries); |
289 } | 289 } |
290 | 290 |
291 return m_clipBoundaries; | 291 return m_clipBoundaries; |
292 } | 292 } |
293 | 293 |
294 } // namespace blink | 294 } // namespace blink |
OLD | NEW |