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

Unified Diff: Source/core/paint/SVGClipPainter.cpp

Issue 1308223003: Remove applyStatefulResource interface from SVGClipPainter (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 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
« no previous file with comments | « Source/core/paint/SVGClipPainter.h ('k') | Source/core/paint/SVGPaintContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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:
« no previous file with comments | « Source/core/paint/SVGClipPainter.h ('k') | Source/core/paint/SVGPaintContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698