| 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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 return false; | 143 return false; |
| 144 | 144 |
| 145 const SVGRenderStyle& svgStyle = style->svgStyle(); | 145 const SVGRenderStyle& svgStyle = style->svgStyle(); |
| 146 | 146 |
| 147 AffineTransform computedPatternSpaceTransform = computeResourceSpaceTransfor
m(object, patternData->transform, svgStyle, resourceMode); | 147 AffineTransform computedPatternSpaceTransform = computeResourceSpaceTransfor
m(object, patternData->transform, svgStyle, resourceMode); |
| 148 patternData->pattern->setPatternSpaceTransform(computedPatternSpaceTransform
); | 148 patternData->pattern->setPatternSpaceTransform(computedPatternSpaceTransform
); |
| 149 | 149 |
| 150 // Draw pattern | 150 // Draw pattern |
| 151 context->save(); | 151 context->save(); |
| 152 | 152 |
| 153 if (resourceMode & ApplyToFillMode) { | 153 if (resourceMode & ApplyToFillMode) |
| 154 context->setAlphaAsFloat(svgStyle.fillOpacity()); | |
| 155 context->setFillPattern(patternData->pattern); | 154 context->setFillPattern(patternData->pattern); |
| 156 context->setFillRule(svgStyle.fillRule()); | 155 else if (resourceMode & ApplyToStrokeMode) |
| 157 } else if (resourceMode & ApplyToStrokeMode) { | |
| 158 context->setAlphaAsFloat(svgStyle.strokeOpacity()); | |
| 159 context->setStrokePattern(patternData->pattern); | 156 context->setStrokePattern(patternData->pattern); |
| 160 SVGRenderSupport::applyStrokeStyleToContext(context, style, object); | |
| 161 } | |
| 162 | 157 |
| 163 if (resourceMode & ApplyToTextMode) { | 158 updateGraphicsContext(context, style, *object, resourceMode); |
| 164 if (resourceMode & ApplyToFillMode) | |
| 165 context->setTextDrawingMode(TextModeFill); | |
| 166 else if (resourceMode & ApplyToStrokeMode) | |
| 167 context->setTextDrawingMode(TextModeStroke); | |
| 168 } | |
| 169 | |
| 170 return true; | 159 return true; |
| 171 } | 160 } |
| 172 | 161 |
| 173 void RenderSVGResourcePattern::postApplyResource(GraphicsContext* context) | 162 void RenderSVGResourcePattern::postApplyResource(GraphicsContext* context) |
| 174 { | 163 { |
| 175 ASSERT(context); | 164 ASSERT(context); |
| 176 context->restore(); | 165 context->restore(); |
| 177 } | 166 } |
| 178 | 167 |
| 179 static inline FloatRect calculatePatternBoundaries(const PatternAttributes& attr
ibutes, | 168 static inline FloatRect calculatePatternBoundaries(const PatternAttributes& attr
ibutes, |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 continue; | 236 continue; |
| 248 if (element->renderer()->needsLayout()) | 237 if (element->renderer()->needsLayout()) |
| 249 return nullptr; | 238 return nullptr; |
| 250 SVGRenderingContext::renderSubtree(tileImage->context(), element->render
er(), contentTransformation); | 239 SVGRenderingContext::renderSubtree(tileImage->context(), element->render
er(), contentTransformation); |
| 251 } | 240 } |
| 252 | 241 |
| 253 return tileImage.release(); | 242 return tileImage.release(); |
| 254 } | 243 } |
| 255 | 244 |
| 256 } | 245 } |
| OLD | NEW |