Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / rendering / svg / RenderSVGResourceMasker.cpp
index b5def17..6e3a84a 100644 (file)
@@ -76,13 +76,11 @@ bool RenderSVGResourceMasker::applyResource(RenderObject* object, RenderStyle*,
     return true;
 }
 
-void RenderSVGResourceMasker::postApplyResource(RenderObject* object, GraphicsContext*& context,
-    unsigned short resourceMode, const Path*, const RenderSVGShape*)
+void RenderSVGResourceMasker::postApplyResource(RenderObject* object, GraphicsContext*& context)
 {
     ASSERT(object);
     ASSERT(context);
     ASSERT(style());
-    ASSERT_UNUSED(resourceMode, resourceMode == ApplyToDefaultMode);
     ASSERT_WITH_SECURITY_IMPLICATION(!needsLayout());
 
     FloatRect paintInvalidationRect = object->paintInvalidationRectInLocalCoordinates();
@@ -122,12 +120,12 @@ void RenderSVGResourceMasker::drawMaskForRenderer(GraphicsContext* context, cons
     }
 
     if (!m_maskContentDisplayList)
-        m_maskContentDisplayList = asDisplayList(context, contentTransformation);
+        createDisplayList(context, contentTransformation);
     ASSERT(m_maskContentDisplayList);
     context->drawDisplayList(m_maskContentDisplayList.get());
 }
 
-PassRefPtr<DisplayList> RenderSVGResourceMasker::asDisplayList(GraphicsContext* context,
+void RenderSVGResourceMasker::createDisplayList(GraphicsContext* context,
     const AffineTransform& contentTransform)
 {
     ASSERT(context);
@@ -135,7 +133,8 @@ PassRefPtr<DisplayList> RenderSVGResourceMasker::asDisplayList(GraphicsContext*
     // Using strokeBoundingBox (instead of paintInvalidationRectInLocalCoordinates) to avoid the intersection
     // with local clips/mask, which may yield incorrect results when mixing objectBoundingBox and
     // userSpaceOnUse units (http://crbug.com/294900).
-    context->beginRecording(strokeBoundingBox());
+    FloatRect bounds = strokeBoundingBox();
+    context->beginRecording(bounds);
     for (SVGElement* childElement = Traversal<SVGElement>::firstChild(*element()); childElement; childElement = Traversal<SVGElement>::nextSibling(*childElement)) {
         RenderObject* renderer = childElement->renderer();
         if (!renderer)
@@ -146,8 +145,7 @@ PassRefPtr<DisplayList> RenderSVGResourceMasker::asDisplayList(GraphicsContext*
 
         SVGRenderingContext::renderSubtree(context, renderer, contentTransform);
     }
-
-    return context->endRecording();
+    m_maskContentDisplayList = context->endRecording();
 }
 
 void RenderSVGResourceMasker::calculateMaskContentPaintInvalidationRect()