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

Unified Diff: Source/core/rendering/svg/RenderSVGResourceClipper.h

Issue 23643003: ImageBuffer-less SVG masking and clipping. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix the Win build. Created 7 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/rendering/RenderObject.cpp ('k') | Source/core/rendering/svg/RenderSVGResourceClipper.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/svg/RenderSVGResourceClipper.h
diff --git a/Source/core/rendering/svg/RenderSVGResourceClipper.h b/Source/core/rendering/svg/RenderSVGResourceClipper.h
index 69ee9865220a65a4369cf1da26cd3bbb93caf5be..7344e7eff60f9643a574e1de3a28fdd844878fe4 100644
--- a/Source/core/rendering/svg/RenderSVGResourceClipper.h
+++ b/Source/core/rendering/svg/RenderSVGResourceClipper.h
@@ -28,7 +28,11 @@ namespace WebCore {
struct ClipperData {
WTF_MAKE_FAST_ALLOCATED;
public:
- OwnPtr<ImageBuffer> clipMaskImage;
+ enum ClipMode { PathOnlyClipMode, MaskClipMode };
+
+ // We should eventually cache the combined clip path here, when switching to path ops clipping.
+ // For now we only cache a marker to let postApply know whether it needs to perform any work.
+ ClipMode clipMode;
};
class RenderSVGResourceClipper FINAL : public RenderSVGResourceContainer {
@@ -41,11 +45,13 @@ public:
virtual void removeAllClientsFromCache(bool markForInvalidation = true);
virtual void removeClientFromCache(RenderObject*, bool markForInvalidation = true);
- virtual bool applyResource(RenderObject*, RenderStyle*, GraphicsContext*&, unsigned short resourceMode);
+ virtual bool applyResource(RenderObject*, RenderStyle*, GraphicsContext*&, unsigned short resourceMode) OVERRIDE;
+ virtual void postApplyResource(RenderObject*, GraphicsContext*&, unsigned short, const Path*, const RenderSVGShape*) OVERRIDE;
// clipPath can be clipped too, but don't have a boundingBox or repaintRect. So we can't call
// applyResource directly and use the rects from the object, since they are empty for RenderSVGResources
// FIXME: We made applyClippingToContext public because we cannot call applyResource on HTML elements (it asserts on RenderObject::objectBoundingBox)
bool applyClippingToContext(RenderObject*, const FloatRect&, const FloatRect&, GraphicsContext*);
+
virtual FloatRect resourceBoundingBox(RenderObject*);
virtual RenderSVGResourceType resourceType() const { return ClipperResourceType; }
@@ -56,12 +62,15 @@ public:
static RenderSVGResourceType s_resourceType;
private:
- bool pathOnlyClipping(GraphicsContext*, const AffineTransform&, const FloatRect&);
- bool drawContentIntoMaskImage(ClipperData*, const FloatRect& objectBoundingBox);
+ bool tryPathOnlyClipping(GraphicsContext*, const AffineTransform&, const FloatRect&);
+ void drawMaskContent(GraphicsContext*, const FloatRect& targetBoundingBox);
void calculateClipContentRepaintRect();
FloatRect m_clipBoundaries;
- HashMap<RenderObject*, ClipperData*> m_clipper;
+ HashMap<const RenderObject*, OwnPtr<ClipperData> > m_rendererToClipperMap;
+
+ // Reference cycle detection.
+ bool m_inClipExpansion;
};
}
« no previous file with comments | « Source/core/rendering/RenderObject.cpp ('k') | Source/core/rendering/svg/RenderSVGResourceClipper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698