OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006 Eric Seidel <eric@webkit.org> | 2 * Copyright (C) 2006 Eric Seidel <eric@webkit.org> |
3 * Copyright (C) 2009 Apple Inc. All rights reserved. | 3 * Copyright (C) 2009 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 10 matching lines...) Expand all Loading... |
21 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 21 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
25 */ | 25 */ |
26 | 26 |
27 #ifndef SVGImage_h | 27 #ifndef SVGImage_h |
28 #define SVGImage_h | 28 #define SVGImage_h |
29 | 29 |
30 #include "platform/graphics/Image.h" | 30 #include "platform/graphics/Image.h" |
31 #include "platform/graphics/paint/DisplayItemClient.h" | |
32 #include "platform/heap/Handle.h" | 31 #include "platform/heap/Handle.h" |
33 #include "platform/weborigin/KURL.h" | 32 #include "platform/weborigin/KURL.h" |
34 #include "wtf/Allocator.h" | 33 #include "wtf/Allocator.h" |
35 | 34 |
36 namespace blink { | 35 namespace blink { |
37 | 36 |
38 class Document; | 37 class Document; |
39 class FrameView; | 38 class FrameView; |
40 class Page; | 39 class Page; |
41 class LayoutReplaced; | 40 class LayoutReplaced; |
42 class SVGImageChromeClient; | 41 class SVGImageChromeClient; |
43 class SVGImageForContainer; | 42 class SVGImageForContainer; |
44 | 43 |
45 class SVGImage final : public Image, public DisplayItemClient { | 44 class SVGImage final : public Image { |
46 public: | 45 public: |
47 static PassRefPtr<SVGImage> create(ImageObserver* observer) | 46 static PassRefPtr<SVGImage> create(ImageObserver* observer) |
48 { | 47 { |
49 return adoptRef(new SVGImage(observer)); | 48 return adoptRef(new SVGImage(observer)); |
50 } | 49 } |
51 | 50 |
52 static bool isInSVGImage(const Node*); | 51 static bool isInSVGImage(const Node*); |
53 | 52 |
54 LayoutReplaced* embeddedReplacedContent() const; | 53 LayoutReplaced* embeddedReplacedContent() const; |
55 | 54 |
(...skipping 19 matching lines...) Expand all Loading... |
75 // Does the SVG image/document contain any animations? | 74 // Does the SVG image/document contain any animations? |
76 bool hasAnimations() const; | 75 bool hasAnimations() const; |
77 | 76 |
78 void updateUseCounters(Document&) const; | 77 void updateUseCounters(Document&) const; |
79 | 78 |
80 // The defaultObjectSize is assumed to be unzoomed, i.e. it should | 79 // The defaultObjectSize is assumed to be unzoomed, i.e. it should |
81 // not have the effective zoom level applied. The returned size is | 80 // not have the effective zoom level applied. The returned size is |
82 // thus also independent of current zoom level. | 81 // thus also independent of current zoom level. |
83 FloatSize concreteObjectSize(const FloatSize& defaultObjectSize) const; | 82 FloatSize concreteObjectSize(const FloatSize& defaultObjectSize) const; |
84 | 83 |
85 // DisplayItemClient methods. | |
86 String debugName() const final { return "SVGImage"; } | |
87 LayoutRect visualRect() const override; | |
88 | |
89 bool hasIntrinsicDimensions() const; | 84 bool hasIntrinsicDimensions() const; |
90 | 85 |
91 private: | 86 private: |
92 friend class AXLayoutObject; | 87 friend class AXLayoutObject; |
93 friend class SVGImageChromeClient; | 88 friend class SVGImageChromeClient; |
94 friend class SVGImageForContainer; | 89 friend class SVGImageForContainer; |
95 | 90 |
96 ~SVGImage() override; | 91 ~SVGImage() override; |
97 | 92 |
98 String filenameExtension() const override; | 93 String filenameExtension() const override; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 { | 141 { |
147 m_image->setImageObserverDisabled(false); | 142 m_image->setImageObserverDisabled(false); |
148 } | 143 } |
149 private: | 144 private: |
150 Image* m_image; | 145 Image* m_image; |
151 }; | 146 }; |
152 | 147 |
153 } // namespace blink | 148 } // namespace blink |
154 | 149 |
155 #endif // SVGImage_h | 150 #endif // SVGImage_h |
OLD | NEW |