OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 3 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 if (m_attributes.hasViewBox() && m_attributes.viewBox().isEmpty()) | 78 if (m_attributes.hasViewBox() && m_attributes.viewBox().isEmpty()) |
79 return 0; | 79 return 0; |
80 | 80 |
81 // Compute all necessary transformations to build the tile image & the patte
rn. | 81 // Compute all necessary transformations to build the tile image & the patte
rn. |
82 FloatRect tileBoundaries; | 82 FloatRect tileBoundaries; |
83 AffineTransform tileImageTransform; | 83 AffineTransform tileImageTransform; |
84 if (!buildTileImageTransform(object, m_attributes, patternElement, tileBound
aries, tileImageTransform)) | 84 if (!buildTileImageTransform(object, m_attributes, patternElement, tileBound
aries, tileImageTransform)) |
85 return 0; | 85 return 0; |
86 | 86 |
87 AffineTransform absoluteTransformIgnoringRotation; | 87 AffineTransform absoluteTransformIgnoringRotation; |
88 SVGRenderingContext::calculateTransformationToOutermostCoordinateSystem(obje
ct, absoluteTransformIgnoringRotation); | 88 SVGRenderingContext::calculateDeviceSpaceTransformation(object, absoluteTran
sformIgnoringRotation); |
89 | 89 |
90 // Ignore 2D rotation, as it doesn't affect the size of the tile. | 90 // Ignore 2D rotation, as it doesn't affect the size of the tile. |
91 SVGRenderingContext::clear2DRotation(absoluteTransformIgnoringRotation); | 91 SVGRenderingContext::clear2DRotation(absoluteTransformIgnoringRotation); |
92 FloatRect absoluteTileBoundaries = absoluteTransformIgnoringRotation.mapRect
(tileBoundaries); | 92 FloatRect absoluteTileBoundaries = absoluteTransformIgnoringRotation.mapRect
(tileBoundaries); |
93 FloatRect clampedAbsoluteTileBoundaries; | 93 FloatRect clampedAbsoluteTileBoundaries; |
94 | 94 |
95 // Scale the tile size to match the scale level of the patternTransform. | 95 // Scale the tile size to match the scale level of the patternTransform. |
96 absoluteTileBoundaries.scale(static_cast<float>(m_attributes.patternTransfor
m().xScale()), | 96 absoluteTileBoundaries.scale(static_cast<float>(m_attributes.patternTransfor
m().xScale()), |
97 static_cast<float>(m_attributes.patternTransform().yScale())); | 97 static_cast<float>(m_attributes.patternTransform().yScale())); |
98 | 98 |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 continue; | 271 continue; |
272 if (element->renderer()->needsLayout()) | 272 if (element->renderer()->needsLayout()) |
273 return nullptr; | 273 return nullptr; |
274 SVGRenderingContext::renderSubtree(tileImage->context(), element->render
er(), contentTransformation); | 274 SVGRenderingContext::renderSubtree(tileImage->context(), element->render
er(), contentTransformation); |
275 } | 275 } |
276 | 276 |
277 return tileImage.release(); | 277 return tileImage.release(); |
278 } | 278 } |
279 | 279 |
280 } | 280 } |
OLD | NEW |