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 * | 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 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 // Only shapes, paths and texts are allowed for clipping. | 247 // Only shapes, paths and texts are allowed for clipping. |
248 if (!renderer->isSVGPath() && !renderer->isSVGText()) | 248 if (!renderer->isSVGPath() && !renderer->isSVGText()) |
249 continue; | 249 continue; |
250 | 250 |
251 // Save the old RenderStyle of the current object for restoring after dr
awing | 251 // Save the old RenderStyle of the current object for restoring after dr
awing |
252 // it to the MaskImage. The new intermediate RenderStyle needs to inheri
t from | 252 // it to the MaskImage. The new intermediate RenderStyle needs to inheri
t from |
253 // the old one. | 253 // the old one. |
254 RefPtr<RenderStyle> oldRenderStyle = renderer->style(); | 254 RefPtr<RenderStyle> oldRenderStyle = renderer->style(); |
255 RefPtr<RenderStyle> newRenderStyle = RenderStyle::clone(oldRenderStyle.g
et()); | 255 RefPtr<RenderStyle> newRenderStyle = RenderStyle::clone(oldRenderStyle.g
et()); |
256 SVGRenderStyle* svgStyle = newRenderStyle.get()->accessSVGStyle(); | 256 SVGRenderStyle* svgStyle = newRenderStyle.get()->accessSVGStyle(); |
257 svgStyle->setFillPaint(SVGRenderStyle::initialFillPaintType(), SVGRender
Style::initialFillPaintColor(), SVGRenderStyle::initialFillPaintUri()); | 257 svgStyle->setFillPaint(SVGPaint::defaultFill()); |
258 svgStyle->setStrokePaint(SVGRenderStyle::initialStrokePaintType(), SVGRe
nderStyle::initialStrokePaintColor(), SVGRenderStyle::initialStrokePaintUri()); | 258 svgStyle->setStrokePaint(SVGPaint::defaultStroke()); |
259 svgStyle->setFillRule(newClipRule); | 259 svgStyle->setFillRule(newClipRule); |
260 newRenderStyle.get()->setOpacity(1.0f); | 260 newRenderStyle.get()->setOpacity(1.0f); |
261 svgStyle->setFillOpacity(1.0f); | 261 svgStyle->setFillOpacity(1.0f); |
262 svgStyle->setStrokeOpacity(1.0f); | 262 svgStyle->setStrokeOpacity(1.0f); |
263 svgStyle->setFilterResource(String()); | 263 svgStyle->setFilterResource(String()); |
264 svgStyle->setMaskerResource(String()); | 264 svgStyle->setMaskerResource(String()); |
265 | 265 |
266 // The setStyle() call results in a styleDidChange() call, which in turn
invalidations the resources. | 266 // The setStyle() call results in a styleDidChange() call, which in turn
invalidations the resources. |
267 // As we're mutating the resource on purpose, block updates until we've
resetted the style again. | 267 // As we're mutating the resource on purpose, block updates until we've
resetted the style again. |
268 m_invalidationBlocked = true; | 268 m_invalidationBlocked = true; |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 transform.scaleNonUniform(objectBoundingBox.width(), objectBoundingBox.h
eight()); | 340 transform.scaleNonUniform(objectBoundingBox.width(), objectBoundingBox.h
eight()); |
341 return transform.mapRect(m_clipBoundaries); | 341 return transform.mapRect(m_clipBoundaries); |
342 } | 342 } |
343 | 343 |
344 return m_clipBoundaries; | 344 return m_clipBoundaries; |
345 } | 345 } |
346 | 346 |
347 } | 347 } |
348 | 348 |
349 #endif // ENABLE(SVG) | 349 #endif // ENABLE(SVG) |
OLD | NEW |