OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) 2004, 2005, 2007, 2008, 2009 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2007, 2008, 2009 Rob Buis <buis@kde.org> |
4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> | 4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> |
5 * Copyright (C) 2009 Google, Inc. | 5 * Copyright (C) 2009 Google, Inc. |
6 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 6 * Copyright (C) Research In Motion Limited 2011. All rights reserved. |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 childPaintInfo.context->save(); | 291 childPaintInfo.context->save(); |
292 | 292 |
293 // Apply initial viewport clip - not affected by overflow handling | 293 // Apply initial viewport clip - not affected by overflow handling |
294 childPaintInfo.context->clip(pixelSnappedIntRect(overflowClipRect(paintOffse
t, paintInfo.renderRegion))); | 294 childPaintInfo.context->clip(pixelSnappedIntRect(overflowClipRect(paintOffse
t, paintInfo.renderRegion))); |
295 | 295 |
296 // Convert from container offsets (html renderers) to a relative transform (
svg renderers). | 296 // Convert from container offsets (html renderers) to a relative transform (
svg renderers). |
297 // Transform from our paint container's coordinate system to our local coord
s. | 297 // Transform from our paint container's coordinate system to our local coord
s. |
298 IntPoint adjustedPaintOffset = roundedIntPoint(paintOffset); | 298 IntPoint adjustedPaintOffset = roundedIntPoint(paintOffset); |
299 childPaintInfo.applyTransform(AffineTransform::translation(adjustedPaintOffs
et.x() - x(), adjustedPaintOffset.y() - y()) * localToParentTransform()); | 299 childPaintInfo.applyTransform(AffineTransform::translation(adjustedPaintOffs
et.x() - x(), adjustedPaintOffset.y() - y()) * localToParentTransform()); |
300 | 300 |
301 SVGRenderingContext renderingContext; | 301 // SVGRenderingContext must be destroyed before we restore the childPaintInf
o.context, because a filter may have |
302 bool continueRendering = true; | 302 // changed the context and it is only reverted when the SVGRenderingContext
destructor finishes applying the filter. |
303 if (childPaintInfo.phase == PaintPhaseForeground) { | 303 { |
304 renderingContext.prepareToRenderSVGContent(this, childPaintInfo); | 304 SVGRenderingContext renderingContext; |
305 continueRendering = renderingContext.isRenderingPrepared(); | 305 bool continueRendering = true; |
| 306 if (childPaintInfo.phase == PaintPhaseForeground) { |
| 307 renderingContext.prepareToRenderSVGContent(this, childPaintInfo); |
| 308 continueRendering = renderingContext.isRenderingPrepared(); |
| 309 } |
| 310 |
| 311 if (continueRendering) |
| 312 RenderBox::paint(childPaintInfo, LayoutPoint()); |
306 } | 313 } |
307 | 314 |
308 if (continueRendering) | |
309 RenderBox::paint(childPaintInfo, LayoutPoint()); | |
310 | |
311 childPaintInfo.context->restore(); | 315 childPaintInfo.context->restore(); |
312 } | 316 } |
313 | 317 |
314 void RenderSVGRoot::willBeDestroyed() | 318 void RenderSVGRoot::willBeDestroyed() |
315 { | 319 { |
316 RenderBlock::removePercentHeightDescendant(const_cast<RenderSVGRoot*>(this))
; | 320 RenderBlock::removePercentHeightDescendant(const_cast<RenderSVGRoot*>(this))
; |
317 | 321 |
318 SVGResourcesCache::clientDestroyed(this); | 322 SVGResourcesCache::clientDestroyed(this); |
319 RenderReplaced::willBeDestroyed(); | 323 RenderReplaced::willBeDestroyed(); |
320 } | 324 } |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
474 while (svgRoot && !svgRoot->isSVGRoot()) | 478 while (svgRoot && !svgRoot->isSVGRoot()) |
475 svgRoot = svgRoot->parent(); | 479 svgRoot = svgRoot->parent(); |
476 if (!svgRoot) | 480 if (!svgRoot) |
477 return; | 481 return; |
478 static_cast<RenderSVGRoot*>(svgRoot)->m_resourcesNeedingToInvalidateClients.
add(resource); | 482 static_cast<RenderSVGRoot*>(svgRoot)->m_resourcesNeedingToInvalidateClients.
add(resource); |
479 } | 483 } |
480 | 484 |
481 } | 485 } |
482 | 486 |
483 #endif // ENABLE(SVG) | 487 #endif // ENABLE(SVG) |
OLD | NEW |