OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> |
4 * Copyright (C) 2005 Eric Seidel <eric@webkit.org> | 4 * Copyright (C) 2005 Eric Seidel <eric@webkit.org> |
5 * Copyright (C) 2006 Apple Computer, Inc | 5 * Copyright (C) 2006 Apple Computer, Inc |
6 * Copyright (C) 2009 Google, Inc. | 6 * Copyright (C) 2009 Google, Inc. |
7 * Copyright (C) 2011 Renata Hodovan <reni@webkit.org> | 7 * Copyright (C) 2011 Renata Hodovan <reni@webkit.org> |
8 * Copyright (C) 2011 University of Szeged | 8 * Copyright (C) 2011 University of Szeged |
9 * | 9 * |
10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
(...skipping 19 matching lines...) Expand all Loading... | |
30 #include "core/rendering/svg/SVGMarkerData.h" | 30 #include "core/rendering/svg/SVGMarkerData.h" |
31 #include "platform/geometry/FloatRect.h" | 31 #include "platform/geometry/FloatRect.h" |
32 #include "platform/transforms/AffineTransform.h" | 32 #include "platform/transforms/AffineTransform.h" |
33 #include "wtf/OwnPtr.h" | 33 #include "wtf/OwnPtr.h" |
34 #include "wtf/Vector.h" | 34 #include "wtf/Vector.h" |
35 | 35 |
36 namespace WebCore { | 36 namespace WebCore { |
37 | 37 |
38 class FloatPoint; | 38 class FloatPoint; |
39 class GraphicsContextStateSaver; | 39 class GraphicsContextStateSaver; |
40 class PointerEventsHitRules; | |
40 class RenderSVGContainer; | 41 class RenderSVGContainer; |
41 class RenderSVGPath; | 42 class RenderSVGPath; |
42 class RenderSVGResource; | 43 class RenderSVGResource; |
43 class SVGGraphicsElement; | 44 class SVGGraphicsElement; |
44 | 45 |
45 class RenderSVGShape : public RenderSVGModelObject { | 46 class RenderSVGShape : public RenderSVGModelObject { |
46 public: | 47 public: |
47 explicit RenderSVGShape(SVGGraphicsElement*); | 48 explicit RenderSVGShape(SVGGraphicsElement*); |
48 RenderSVGShape(SVGGraphicsElement*, Path*, bool); | 49 RenderSVGShape(SVGGraphicsElement*, Path*, bool); |
49 virtual ~RenderSVGShape(); | 50 virtual ~RenderSVGShape(); |
(...skipping 21 matching lines...) Expand all Loading... | |
71 bool hasSmoothStroke() const; | 72 bool hasSmoothStroke() const; |
72 | 73 |
73 bool hasNonScalingStroke() const { return style()->svgStyle()->vectorEffect( ) == VE_NON_SCALING_STROKE; } | 74 bool hasNonScalingStroke() const { return style()->svgStyle()->vectorEffect( ) == VE_NON_SCALING_STROKE; } |
74 AffineTransform nonScalingStrokeTransform() const; | 75 AffineTransform nonScalingStrokeTransform() const; |
75 Path* nonScalingStrokePath(const Path*, const AffineTransform&) const; | 76 Path* nonScalingStrokePath(const Path*, const AffineTransform&) const; |
76 | 77 |
77 FloatRect m_fillBoundingBox; | 78 FloatRect m_fillBoundingBox; |
78 FloatRect m_strokeBoundingBox; | 79 FloatRect m_strokeBoundingBox; |
79 | 80 |
80 private: | 81 private: |
82 friend class SVGGeometryElement; | |
krit
2013/11/09 02:20:18
The new IDL was designed to avoid things like that
rwlbuis
2013/11/11 16:54:58
I just did not want to expose nodeAtFloatPointInte
| |
83 | |
81 // Hit-detection separated for the fill and the stroke | 84 // Hit-detection separated for the fill and the stroke |
82 bool fillContains(const FloatPoint&, bool requiresFill = true, const WindRul e fillRule = RULE_NONZERO); | 85 bool fillContains(const FloatPoint&, bool requiresFill = true, const WindRul e fillRule = RULE_NONZERO); |
83 bool strokeContains(const FloatPoint&, bool requiresStroke = true); | 86 bool strokeContains(const FloatPoint&, bool requiresStroke = true); |
84 | 87 |
85 virtual FloatRect repaintRectInLocalCoordinates() const OVERRIDE FINAL { ret urn m_repaintBoundingBox; } | 88 virtual FloatRect repaintRectInLocalCoordinates() const OVERRIDE FINAL { ret urn m_repaintBoundingBox; } |
86 virtual const AffineTransform& localToParentTransform() const OVERRIDE FINAL { return m_localTransform; } | 89 virtual const AffineTransform& localToParentTransform() const OVERRIDE FINAL { return m_localTransform; } |
87 virtual AffineTransform localTransform() const OVERRIDE FINAL { return m_loc alTransform; } | 90 virtual AffineTransform localTransform() const OVERRIDE FINAL { return m_loc alTransform; } |
88 | 91 |
89 virtual bool isSVGShape() const OVERRIDE FINAL { return true; } | 92 virtual bool isSVGShape() const OVERRIDE FINAL { return true; } |
90 virtual const char* renderName() const { return "RenderSVGShape"; } | 93 virtual const char* renderName() const { return "RenderSVGShape"; } |
91 | 94 |
92 virtual void layout() OVERRIDE FINAL; | 95 virtual void layout() OVERRIDE FINAL; |
93 virtual void paint(PaintInfo&, const LayoutPoint&) OVERRIDE FINAL; | 96 virtual void paint(PaintInfo&, const LayoutPoint&) OVERRIDE FINAL; |
94 virtual void addFocusRingRects(Vector<IntRect>&, const LayoutPoint& addition alOffset, const RenderLayerModelObject* paintContainer = 0) OVERRIDE FINAL; | 97 virtual void addFocusRingRects(Vector<IntRect>&, const LayoutPoint& addition alOffset, const RenderLayerModelObject* paintContainer = 0) OVERRIDE FINAL; |
95 | 98 |
96 virtual bool nodeAtFloatPoint(const HitTestRequest&, HitTestResult&, const F loatPoint& pointInParent, HitTestAction) OVERRIDE FINAL; | 99 virtual bool nodeAtFloatPoint(const HitTestRequest&, HitTestResult&, const F loatPoint& pointInParent, HitTestAction) OVERRIDE FINAL; |
100 bool nodeAtFloatPointInternal(const HitTestRequest&, const FloatPoint&, Poin terEventsHitRules); | |
97 | 101 |
98 virtual FloatRect objectBoundingBox() const OVERRIDE FINAL { return m_fillBo undingBox; } | 102 virtual FloatRect objectBoundingBox() const OVERRIDE FINAL { return m_fillBo undingBox; } |
99 virtual FloatRect strokeBoundingBox() const OVERRIDE FINAL { return m_stroke BoundingBox; } | 103 virtual FloatRect strokeBoundingBox() const OVERRIDE FINAL { return m_stroke BoundingBox; } |
100 FloatRect calculateObjectBoundingBox() const; | 104 FloatRect calculateObjectBoundingBox() const; |
101 FloatRect calculateStrokeBoundingBox() const; | 105 FloatRect calculateStrokeBoundingBox() const; |
102 void updateRepaintBoundingBox(); | 106 void updateRepaintBoundingBox(); |
103 | 107 |
104 bool setupNonScalingStrokeContext(AffineTransform&, GraphicsContextStateSave r&); | 108 bool setupNonScalingStrokeContext(AffineTransform&, GraphicsContextStateSave r&); |
105 | 109 |
106 bool shouldGenerateMarkerPositions() const; | 110 bool shouldGenerateMarkerPositions() const; |
(...skipping 14 matching lines...) Expand all Loading... | |
121 bool m_needsBoundariesUpdate : 1; | 125 bool m_needsBoundariesUpdate : 1; |
122 bool m_needsShapeUpdate : 1; | 126 bool m_needsShapeUpdate : 1; |
123 bool m_needsTransformUpdate : 1; | 127 bool m_needsTransformUpdate : 1; |
124 }; | 128 }; |
125 | 129 |
126 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderSVGShape, isSVGShape()); | 130 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderSVGShape, isSVGShape()); |
127 | 131 |
128 } | 132 } |
129 | 133 |
130 #endif | 134 #endif |
OLD | NEW |