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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 else if (resourceMode & ApplyToStrokeMode) | 167 else if (resourceMode & ApplyToStrokeMode) |
168 context->setTextDrawingMode(TextModeStroke); | 168 context->setTextDrawingMode(TextModeStroke); |
169 } | 169 } |
170 | 170 |
171 return true; | 171 return true; |
172 } | 172 } |
173 | 173 |
174 void RenderSVGResourcePattern::postApplyResource(RenderObject*, GraphicsContext*
& context, unsigned short resourceMode, const Path* path, const RenderSVGShape*
shape) | 174 void RenderSVGResourcePattern::postApplyResource(RenderObject*, GraphicsContext*
& context, unsigned short resourceMode, const Path* path, const RenderSVGShape*
shape) |
175 { | 175 { |
176 ASSERT(context); | 176 ASSERT(context); |
177 ASSERT(resourceMode != ApplyToDefaultMode); | 177 SVGRenderSupport::fillOrStrokePrimitive(context, resourceMode, path, shape); |
178 | |
179 if (resourceMode & ApplyToFillMode) { | |
180 if (path) | |
181 context->fillPath(*path); | |
182 else if (shape) | |
183 shape->fillShape(context); | |
184 } | |
185 if (resourceMode & ApplyToStrokeMode) { | |
186 if (path) | |
187 context->strokePath(*path); | |
188 else if (shape) | |
189 shape->strokeShape(context); | |
190 } | |
191 | 178 |
192 context->restore(); | 179 context->restore(); |
193 } | 180 } |
194 | 181 |
195 static inline FloatRect calculatePatternBoundaries(const PatternAttributes& attr
ibutes, | 182 static inline FloatRect calculatePatternBoundaries(const PatternAttributes& attr
ibutes, |
196 const FloatRect& objectBoundi
ngBox, | 183 const FloatRect& objectBoundi
ngBox, |
197 const SVGPatternElement* patt
ernElement) | 184 const SVGPatternElement* patt
ernElement) |
198 { | 185 { |
199 ASSERT(patternElement); | 186 ASSERT(patternElement); |
200 return SVGLengthContext::resolveRectangle(patternElement, attributes.pattern
Units(), objectBoundingBox, attributes.x(), attributes.y(), attributes.width(),
attributes.height()); | 187 return SVGLengthContext::resolveRectangle(patternElement, attributes.pattern
Units(), objectBoundingBox, attributes.x(), attributes.y(), attributes.width(),
attributes.height()); |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 continue; | 250 continue; |
264 if (element->renderer()->needsLayout()) | 251 if (element->renderer()->needsLayout()) |
265 return nullptr; | 252 return nullptr; |
266 SVGRenderingContext::renderSubtree(tileImage->context(), element->render
er(), contentTransformation); | 253 SVGRenderingContext::renderSubtree(tileImage->context(), element->render
er(), contentTransformation); |
267 } | 254 } |
268 | 255 |
269 return tileImage.release(); | 256 return tileImage.release(); |
270 } | 257 } |
271 | 258 |
272 } | 259 } |
OLD | NEW |