Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(285)

Unified Diff: Source/WebCore/rendering/svg/RenderSVGResourceMasker.cpp

Issue 9235065: Merge 105978 - crash in WebCore::RenderSVGContainer::paint (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/963/
Patch Set: Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/WebCore/rendering/svg/RenderSVGResourceMasker.cpp
===================================================================
--- Source/WebCore/rendering/svg/RenderSVGResourceMasker.cpp (revision 106008)
+++ Source/WebCore/rendering/svg/RenderSVGResourceMasker.cpp (working copy)
@@ -117,7 +117,10 @@
maskImageContext->translate(-clampedAbsoluteTargetRect.x(), -clampedAbsoluteTargetRect.y());
maskImageContext->concatCTM(absoluteTransform);
- drawContentIntoMaskImage(maskerData, colorSpace, maskElement, object);
+ if (!drawContentIntoMaskImage(maskerData, colorSpace, maskElement, object)) {
+ maskImageContext->restore();
+ maskerData->maskImage.clear();
+ }
}
if (!maskerData->maskImage)
@@ -127,7 +130,7 @@
return true;
}
-void RenderSVGResourceMasker::drawContentIntoMaskImage(MaskerData* maskerData, ColorSpace colorSpace, const SVGMaskElement* maskElement, RenderObject* object)
+bool RenderSVGResourceMasker::drawContentIntoMaskImage(MaskerData* maskerData, ColorSpace colorSpace, const SVGMaskElement* maskElement, RenderObject* object)
{
GraphicsContext* maskImageContext = maskerData->maskImage->context();
ASSERT(maskImageContext);
@@ -146,6 +149,8 @@
RenderObject* renderer = node->renderer();
if (!node->isSVGElement() || !static_cast<SVGElement*>(node)->isStyled() || !renderer)
continue;
+ if (renderer->needsLayout())
+ return false;
RenderStyle* style = renderer->style();
if (!style || style->display() == NONE || style->visibility() != VISIBLE)
continue;
@@ -162,6 +167,7 @@
// Create the luminance mask.
maskerData->maskImage->convertToLuminanceMask();
+ return true;
}
void RenderSVGResourceMasker::calculateMaskContentRepaintRect()
« no previous file with comments | « Source/WebCore/rendering/svg/RenderSVGResourceMasker.h ('k') | Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698