|
1 /* |
|
2 Copyright (C) 2006 Alexander Kellett <lypanov@kde.org> |
|
3 Copyright (C) 2006, 2009 Apple Inc. All rights reserved. |
|
4 Copyright (C) 2007 Rob Buis <buis@kde.org> |
|
5 Copyright (C) 2009 Google, Inc. |
|
6 |
|
7 This library is free software; you can redistribute it and/or |
|
8 modify it under the terms of the GNU Library General Public |
|
9 License as published by the Free Software Foundation; either |
|
10 version 2 of the License, or (at your option) any later version. |
|
11 |
|
12 This library is distributed in the hope that it will be useful, |
|
13 but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
15 Library General Public License for more details. |
|
16 |
|
17 You should have received a copy of the GNU Library General Public License |
|
18 along with this library; see the file COPYING.LIB. If not, write to |
|
19 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
|
20 Boston, MA 02110-1301, USA. |
|
21 */ |
|
22 |
|
23 #ifndef RenderSVGImage_h |
|
24 #define RenderSVGImage_h |
|
25 |
|
26 #if ENABLE(SVG) |
|
27 #include "AffineTransform.h" |
|
28 #include "FloatRect.h" |
|
29 #include "RenderImage.h" |
|
30 #include "SVGPreserveAspectRatio.h" |
|
31 #include "SVGRenderSupport.h" |
|
32 |
|
33 namespace WebCore { |
|
34 |
|
35 class SVGImageElement; |
|
36 |
|
37 class RenderSVGImage : public RenderImage { |
|
38 public: |
|
39 RenderSVGImage(SVGImageElement*); |
|
40 |
|
41 virtual void setNeedsTransformUpdate() { m_needsTransformUpdate = true; } |
|
42 |
|
43 private: |
|
44 virtual const char* renderName() const { return "RenderSVGImage"; } |
|
45 virtual bool isSVGImage() const { return true; } |
|
46 |
|
47 virtual const AffineTransform& localToParentTransform() const { return m_localTransform; } |
|
48 |
|
49 virtual FloatRect objectBoundingBox() const { return m_localBounds; } |
|
50 virtual FloatRect strokeBoundingBox() const { return m_localBounds; } |
|
51 virtual FloatRect repaintRectInLocalCoordinates() const; |
|
52 |
|
53 virtual IntRect clippedOverflowRectForRepaint(RenderBoxModelObject* repaintContainer); |
|
54 virtual void computeRectForRepaint(RenderBoxModelObject* repaintContainer, IntRect&, bool fixed = false); |
|
55 |
|
56 virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool useTransforms, bool fixed, TransformState&) const; |
|
57 |
|
58 virtual void absoluteRects(Vector<IntRect>&, int tx, int ty); |
|
59 virtual void absoluteQuads(Vector<FloatQuad>&); |
|
60 virtual void addFocusRingRects(Vector<IntRect>&, int tx, int ty); |
|
61 |
|
62 virtual void imageChanged(WrappedImagePtr, const IntRect* = 0); |
|
63 |
|
64 virtual void layout(); |
|
65 virtual void paint(PaintInfo&, int parentX, int parentY); |
|
66 |
|
67 virtual void destroy(); |
|
68 |
|
69 virtual bool requiresLayer() const { return false; } |
|
70 |
|
71 virtual bool nodeAtFloatPoint(const HitTestRequest&, HitTestResult&, const FloatPoint& pointInParent, HitTestAction); |
|
72 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction); |
|
73 |
|
74 virtual AffineTransform localTransform() const { return m_localTransform; } |
|
75 |
|
76 bool m_needsTransformUpdate : 1; |
|
77 AffineTransform m_localTransform; |
|
78 FloatRect m_localBounds; |
|
79 mutable FloatRect m_cachedLocalRepaintRect; |
|
80 }; |
|
81 |
|
82 } // namespace WebCore |
|
83 |
|
84 #endif // ENABLE(SVG) |
|
85 #endif // RenderSVGImage_h |