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

Unified Diff: Source/core/layout/svg/LayoutSVGResourceClipper.h

Issue 979883002: [S.P.] Move clip painting to SVGClipPainter. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: codereview fixes Created 5 years, 9 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/core.gypi ('k') | Source/core/layout/svg/LayoutSVGResourceClipper.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/svg/LayoutSVGResourceClipper.h
diff --git a/Source/core/layout/svg/LayoutSVGResourceClipper.h b/Source/core/layout/svg/LayoutSVGResourceClipper.h
index f8713deb0d5abf3b53f8fc5a8e76f8d2291453d0..725284bfc85dea99db56b607cba6574aaebc7028 100644
--- a/Source/core/layout/svg/LayoutSVGResourceClipper.h
+++ b/Source/core/layout/svg/LayoutSVGResourceClipper.h
@@ -29,12 +29,6 @@ namespace blink {
class LayoutSVGResourceClipper final : public LayoutSVGResourceContainer {
public:
- enum ClipperState {
- ClipperNotApplied,
- ClipperAppliedPath,
- ClipperAppliedMask
- };
-
explicit LayoutSVGResourceClipper(SVGClipPathElement*);
virtual ~LayoutSVGResourceClipper();
@@ -43,17 +37,6 @@ public:
virtual void removeAllClientsFromCache(bool markForInvalidation = true) override;
virtual void removeClientFromCache(LayoutObject*, bool markForInvalidation = true) override;
- // FIXME: Filters are also stateful resources that could benefit from having their state managed
- // on the caller stack instead of the current hashmap. We should look at refactoring these
- // into a general interface that can be shared.
- bool applyStatefulResource(LayoutObject*, GraphicsContext*&, ClipperState&);
- void postApplyStatefulResource(LayoutObject*, GraphicsContext*&, ClipperState&);
-
- // clipPath can be clipped too, but don't have a boundingBox or paintInvalidationRect. So we can't call
- // applyResource directly and use the rects from the object, since they are empty for LayoutSVGResources
- // FIXME: We made applyClippingToContext public because we cannot call applyResource on HTML elements (it asserts on LayoutObject::objectBoundingBox)
- bool applyClippingToContext(LayoutObject*, const FloatRect&, const FloatRect&, GraphicsContext*, ClipperState&);
-
FloatRect resourceBoundingBox(const LayoutObject*);
static const LayoutSVGResourceType s_resourceType = ClipperResourceType;
@@ -63,10 +46,13 @@ public:
SVGUnitTypes::SVGUnitType clipPathUnits() const { return toSVGClipPathElement(element())->clipPathUnits()->currentValue()->enumValue(); }
-private:
bool tryPathOnlyClipping(DisplayItemClient, GraphicsContext*, const AffineTransform&, const FloatRect&);
- void drawClipMaskContent(GraphicsContext*, DisplayItemClient, const FloatRect& targetBoundingBox);
- PassRefPtr<const SkPicture> createPicture();
+ PassRefPtr<const SkPicture> createContentPicture(AffineTransform&, const FloatRect&);
+
+ bool hasCycle() { return m_inClipExpansion; }
+ void beginClipExpansion() { ASSERT(!m_inClipExpansion); m_inClipExpansion = true; }
+ void endClipExpansion() { ASSERT(m_inClipExpansion); m_inClipExpansion = false; }
+private:
void calculateClipContentPaintInvalidationRect();
RefPtr<const SkPicture> m_clipContentPicture;
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/layout/svg/LayoutSVGResourceClipper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698