Chromium Code Reviews| 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..fcc6ae48580f71a74c6553e89dec6060bbbf4ef1 100644 |
| --- a/Source/core/rendering/svg/RenderSVGResourceClipper.h |
| +++ b/Source/core/rendering/svg/RenderSVGResourceClipper.h |
| @@ -28,7 +28,14 @@ namespace WebCore { |
| struct ClipperData { |
| WTF_MAKE_FAST_ALLOCATED; |
| public: |
| - OwnPtr<ImageBuffer> clipMaskImage; |
| + ClipperData() |
| + : pathOnly(false) |
| + { |
| + } |
| + |
| + // 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. |
| + bool pathOnly : 1; |
|
pdr.
2013/08/28 03:32:36
Using an enum may make this easier to understand.
f(malita)
2013/08/28 19:54:38
Done.
|
| }; |
| class RenderSVGResourceClipper FINAL : public RenderSVGResourceContainer { |
| @@ -41,11 +48,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 |
|
pdr.
2013/08/28 03:32:36
Not your fault, but this comment is more confusing
|
| // 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; } |
| @@ -57,11 +66,14 @@ public: |
| static RenderSVGResourceType s_resourceType; |
| private: |
| bool pathOnlyClipping(GraphicsContext*, const AffineTransform&, const FloatRect&); |
| - bool drawContentIntoMaskImage(ClipperData*, const FloatRect& objectBoundingBox); |
| + void drawMaskContent(GraphicsContext*, const FloatRect& targetBoundingBox); |
| void calculateClipContentRepaintRect(); |
| FloatRect m_clipBoundaries; |
| - HashMap<RenderObject*, ClipperData*> m_clipper; |
| + HashMap<const RenderObject*, OwnPtr<ClipperData> > m_clipperMap; |
|
pdr.
2013/08/28 03:32:36
<bikeshed> m_rendererToClipperMap?
f(malita)
2013/08/28 19:54:38
Done.
|
| + |
| + // Reference cycle detection. |
| + bool m_inClipExpansion; |
| }; |
| } |