| Index: Source/core/paint/SVGClipPainter.cpp
|
| diff --git a/Source/core/paint/SVGClipPainter.cpp b/Source/core/paint/SVGClipPainter.cpp
|
| index 2ad91ba5e6cad7fd7fc54aed54877b3d0313aa6d..fbc23ff9ae14bd18e27dcd65243516719cb7e18e 100644
|
| --- a/Source/core/paint/SVGClipPainter.cpp
|
| +++ b/Source/core/paint/SVGClipPainter.cpp
|
| @@ -17,18 +17,10 @@
|
| #include "platform/graphics/paint/CompositingDisplayItem.h"
|
| #include "platform/graphics/paint/DisplayItemList.h"
|
| #include "platform/graphics/paint/DrawingDisplayItem.h"
|
| -#include "wtf/TemporaryChange.h"
|
|
|
| namespace blink {
|
|
|
| -bool SVGClipPainter::applyStatefulResource(const LayoutObject& object, GraphicsContext* context, ClipperState& clipperState)
|
| -{
|
| - ASSERT(context);
|
| -
|
| - m_clip.clearInvalidationMask();
|
| -
|
| - return applyClippingToContext(object, object.objectBoundingBox(), object.paintInvalidationRectInLocalCoordinates(), context, clipperState);
|
| -}
|
| +namespace {
|
|
|
| class SVGClipExpansionCycleHelper {
|
| public:
|
| @@ -38,13 +30,17 @@ private:
|
| LayoutSVGResourceClipper& m_clip;
|
| };
|
|
|
| -bool SVGClipPainter::applyClippingToContext(const LayoutObject& target, const FloatRect& targetBoundingBox,
|
| +}
|
| +
|
| +bool SVGClipPainter::prepareEffect(const LayoutObject& target, const FloatRect& targetBoundingBox,
|
| const FloatRect& paintInvalidationRect, GraphicsContext* context, ClipperState& clipperState)
|
| {
|
| ASSERT(context);
|
| ASSERT(clipperState == ClipperNotApplied);
|
| ASSERT_WITH_SECURITY_IMPLICATION(!m_clip.needsLayout());
|
|
|
| + m_clip.clearInvalidationMask();
|
| +
|
| if (paintInvalidationRect.isEmpty() || m_clip.hasCycle())
|
| return false;
|
|
|
| @@ -77,7 +73,7 @@ bool SVGClipPainter::applyClippingToContext(const LayoutObject& target, const Fl
|
| SVGResources* resources = SVGResourcesCache::cachedResourcesForLayoutObject(&m_clip);
|
| LayoutSVGResourceClipper* clipPathClipper = resources ? resources->clipper() : 0;
|
| ClipperState clipPathClipperState = ClipperNotApplied;
|
| - if (clipPathClipper && !SVGClipPainter(*clipPathClipper).applyClippingToContext(m_clip, targetBoundingBox, paintInvalidationRect, context, clipPathClipperState)) {
|
| + if (clipPathClipper && !SVGClipPainter(*clipPathClipper).prepareEffect(m_clip, targetBoundingBox, paintInvalidationRect, context, clipPathClipperState)) {
|
| // End the clip mask's compositor.
|
| CompositingRecorder::endCompositing(*context, target);
|
| return false;
|
| @@ -86,7 +82,7 @@ bool SVGClipPainter::applyClippingToContext(const LayoutObject& target, const Fl
|
| drawClipMaskContent(context, target, targetBoundingBox, paintInvalidationRect);
|
|
|
| if (clipPathClipper)
|
| - SVGClipPainter(*clipPathClipper).postApplyStatefulResource(m_clip, context, clipPathClipperState);
|
| + SVGClipPainter(*clipPathClipper).finishEffect(m_clip, context, clipPathClipperState);
|
| }
|
|
|
| // Masked content layer start.
|
| @@ -95,7 +91,7 @@ bool SVGClipPainter::applyClippingToContext(const LayoutObject& target, const Fl
|
| return true;
|
| }
|
|
|
| -void SVGClipPainter::postApplyStatefulResource(const LayoutObject& target, GraphicsContext* context, ClipperState& clipperState)
|
| +void SVGClipPainter::finishEffect(const LayoutObject& target, GraphicsContext* context, ClipperState& clipperState)
|
| {
|
| switch (clipperState) {
|
| case ClipperAppliedPath:
|
|
|