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 * Copyright 2014 The Chromium Authors. All rights reserved. | 4 * Copyright 2014 The Chromium Authors. All rights reserved. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 | 86 |
87 // An empty viewBox disables rendering. | 87 // An empty viewBox disables rendering. |
88 if (attributes.hasViewBox() && attributes.viewBox().isEmpty()) | 88 if (attributes.hasViewBox() && attributes.viewBox().isEmpty()) |
89 return nullptr; | 89 return nullptr; |
90 | 90 |
91 ASSERT(element()); | 91 ASSERT(element()); |
92 // Compute tile metrics. | 92 // Compute tile metrics. |
93 FloatRect clientBoundingBox = object.objectBoundingBox(); | 93 FloatRect clientBoundingBox = object.objectBoundingBox(); |
94 FloatRect tileBounds = SVGLengthContext::resolveRectangle(element(), | 94 FloatRect tileBounds = SVGLengthContext::resolveRectangle(element(), |
95 attributes.patternUnits(), clientBoundingBox, | 95 attributes.patternUnits(), clientBoundingBox, |
96 attributes.x(), attributes.y(), attributes.width(), attributes.height())
; | 96 *attributes.x(), *attributes.y(), *attributes.width(), *attributes.heigh
t()); |
97 if (tileBounds.isEmpty()) | 97 if (tileBounds.isEmpty()) |
98 return nullptr; | 98 return nullptr; |
99 | 99 |
100 AffineTransform tileTransform; | 100 AffineTransform tileTransform; |
101 if (attributes.hasViewBox()) { | 101 if (attributes.hasViewBox()) { |
102 if (attributes.viewBox().isEmpty()) | 102 if (attributes.viewBox().isEmpty()) |
103 return nullptr; | 103 return nullptr; |
104 tileTransform = SVGFitToViewBox::viewBoxToViewTransform(attributes.viewB
ox(), | 104 tileTransform = SVGFitToViewBox::viewBoxToViewTransform(attributes.viewB
ox(), |
105 attributes.preserveAspectRatio(), tileBounds.width(), tileBounds.hei
ght()); | 105 attributes.preserveAspectRatio(), tileBounds.width(), tileBounds.hei
ght()); |
106 } else { | 106 } else { |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 for (LayoutObject* child = patternRenderer->firstChild(); child; child =
child->nextSibling()) | 185 for (LayoutObject* child = patternRenderer->firstChild(); child; child =
child->nextSibling()) |
186 SVGPaintContext::paintSubtree(&recordingContext, child); | 186 SVGPaintContext::paintSubtree(&recordingContext, child); |
187 } | 187 } |
188 | 188 |
189 if (displayItemList) | 189 if (displayItemList) |
190 displayItemList->replay(&recordingContext); | 190 displayItemList->replay(&recordingContext); |
191 return recordingContext.endRecording(); | 191 return recordingContext.endRecording(); |
192 } | 192 } |
193 | 193 |
194 } | 194 } |
OLD | NEW |