#include "core/rendering/svg/RenderSVGResourceContainer.h"
#include "core/svg/SVGClipPathElement.h"
-namespace WebCore {
+namespace blink {
class DisplayList;
explicit RenderSVGResourceClipper(SVGClipPathElement*);
virtual ~RenderSVGResourceClipper();
- virtual const char* renderName() const { return "RenderSVGResourceClipper"; }
+ virtual const char* renderName() const OVERRIDE { return "RenderSVGResourceClipper"; }
- virtual void removeAllClientsFromCache(bool markForInvalidation = true);
- virtual void removeClientFromCache(RenderObject*, bool markForInvalidation = true);
+ virtual void removeAllClientsFromCache(bool markForInvalidation = true) OVERRIDE;
+ virtual void removeClientFromCache(RenderObject*, bool markForInvalidation = true) OVERRIDE;
- virtual bool applyResource(RenderObject*, RenderStyle*, GraphicsContext*&, unsigned short resourceMode) OVERRIDE FINAL;
- virtual void postApplyResource(RenderObject*, GraphicsContext*&, unsigned short, const Path*, const RenderSVGShape*) OVERRIDE FINAL;
+ virtual bool applyResource(RenderObject*, RenderStyle*, GraphicsContext*&, unsigned short resourceMode) OVERRIDE;
+ virtual void postApplyResource(RenderObject*, GraphicsContext*&, unsigned short, const Path*, const RenderSVGShape*) 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
bool applyStatefulResource(RenderObject*, GraphicsContext*&, ClipperContext&);
void postApplyStatefulResource(RenderObject*, GraphicsContext*&, ClipperContext&);
- // clipPath can be clipped too, but don't have a boundingBox or repaintRect. So we can't call
+ // 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 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*, ClipperContext&);
- FloatRect resourceBoundingBox(RenderObject*);
+ FloatRect resourceBoundingBox(const RenderObject*);
- virtual RenderSVGResourceType resourceType() const { return s_resourceType; }
+ virtual RenderSVGResourceType resourceType() const OVERRIDE { return s_resourceType; }
bool hitTestClipContent(const FloatRect&, const FloatPoint&);
- SVGUnitTypes::SVGUnitType clipPathUnits() const { return toSVGClipPathElement(element())->clipPathUnitsCurrentValue(); }
+ SVGUnitTypes::SVGUnitType clipPathUnits() const { return toSVGClipPathElement(element())->clipPathUnits()->currentValue()->enumValue(); }
static const RenderSVGResourceType s_resourceType;
private:
bool tryPathOnlyClipping(GraphicsContext*, const AffineTransform&, const FloatRect&);
void drawClipMaskContent(GraphicsContext*, const FloatRect& targetBoundingBox);
PassRefPtr<DisplayList> asDisplayList(GraphicsContext*, const AffineTransform&);
- void calculateClipContentRepaintRect();
+ void calculateClipContentPaintInvalidationRect();
RefPtr<DisplayList> m_clipContentDisplayList;
FloatRect m_clipBoundaries;
bool m_inClipExpansion;
};
-inline RenderSVGResourceClipper* toRenderSVGResourceClipper(RenderSVGResource* resource)
-{
- ASSERT_WITH_SECURITY_IMPLICATION(!resource || resource->resourceType() == ClipperResourceType);
- return static_cast<RenderSVGResourceClipper*>(resource);
-}
+DEFINE_RENDER_SVG_RESOURCE_TYPE_CASTS(RenderSVGResourceClipper, ClipperResourceType);
}