| 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;
|
| };
|
|
|
| }
|
|
|