diff options
Diffstat (limited to 'WebCore/rendering/SVGRenderSupport.cpp')
-rw-r--r-- | WebCore/rendering/SVGRenderSupport.cpp | 42 |
1 files changed, 6 insertions, 36 deletions
diff --git a/WebCore/rendering/SVGRenderSupport.cpp b/WebCore/rendering/SVGRenderSupport.cpp index e265b2b..12d6d77 100644 --- a/WebCore/rendering/SVGRenderSupport.cpp +++ b/WebCore/rendering/SVGRenderSupport.cpp @@ -33,7 +33,6 @@ #include "NodeRenderStyle.h" #include "RenderLayer.h" #include "RenderPath.h" -#include "RenderSVGContainer.h" #include "RenderSVGResource.h" #include "RenderSVGResourceClipper.h" #include "RenderSVGResourceFilter.h" @@ -116,8 +115,10 @@ bool SVGRenderSupport::prepareToRenderSVGContent(RenderObject* object, PaintInfo return false; } - if (RenderSVGResourceClipper* clipper = resources->clipper()) - clipper->applyResource(object, style, paintInfo.context, ApplyToDefaultMode); + if (RenderSVGResourceClipper* clipper = resources->clipper()) { + if (!clipper->applyResource(object, style, paintInfo.context, ApplyToDefaultMode)) + return false; + } #if ENABLE(FILTERS) if (RenderSVGResourceFilter* filter = resources->filter()) { @@ -163,37 +164,6 @@ void SVGRenderSupport::finishRenderSVGContent(RenderObject* object, PaintInfo& p paintInfo.context->endTransparencyLayer(); } -void SVGRenderSupport::renderSubtreeToImage(ImageBuffer* image, RenderObject* item) -{ - ASSERT(item); - ASSERT(image); - ASSERT(image->context()); - - // FIXME: This sets the rect to the viewable area of the current frame. This - // is used to support text drawings to the ImageBuffer. See bug 30399. - IntRect rect; - FrameView* frameView = item->document()->view(); - if (frameView) - rect = IntRect(0, 0, frameView->visibleWidth(), frameView->visibleHeight()); - PaintInfo info(image->context(), rect, PaintPhaseForeground, 0, 0, 0); - - // FIXME: isSVGContainer returns true for RenderSVGViewportContainer, so if this is ever - // called with one of those, we will read from the wrong offset in an object due to a bad cast. - RenderSVGContainer* svgContainer = 0; - if (item && item->isSVGContainer()) - svgContainer = toRenderSVGContainer(item); - - bool drawsContents = svgContainer ? svgContainer->drawsContents() : false; - if (svgContainer && !drawsContents) - svgContainer->setDrawsContents(true); - - item->layoutIfNeeded(); - item->paint(info, 0, 0); - - if (svgContainer && !drawsContents) - svgContainer->setDrawsContents(false); -} - FloatRect SVGRenderSupport::computeContainerBoundingBox(const RenderObject* container, ContainerBoundingBoxMode mode) { FloatRect boundingBox; @@ -219,7 +189,7 @@ FloatRect SVGRenderSupport::computeContainerBoundingBox(const RenderObject* cont return boundingBox; } -static inline RenderSVGRoot* svgRootTreeObject(RenderObject* start) +const RenderSVGRoot* SVGRenderSupport::findTreeRootObject(const RenderObject* start) { while (start && !start->isSVGRoot()) start = start->parent(); @@ -241,7 +211,7 @@ static inline void invalidateResourcesOfChildren(RenderObject* start) void SVGRenderSupport::layoutChildren(RenderObject* start, bool selfNeedsLayout) { - bool layoutSizeChanged = svgRootTreeObject(start)->isLayoutSizeChanged(); + bool layoutSizeChanged = findTreeRootObject(start)->isLayoutSizeChanged(); HashSet<RenderObject*> notlayoutedObjects; for (RenderObject* child = start->firstChild(); child; child = child->nextSibling()) { |