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 15 matching lines...) Expand all Loading... | |
26 | 26 |
27 #ifndef SVGImage_h | 27 #ifndef SVGImage_h |
28 #define SVGImage_h | 28 #define SVGImage_h |
29 | 29 |
30 #include "core/CoreExport.h" | 30 #include "core/CoreExport.h" |
31 #include "platform/graphics/Image.h" | 31 #include "platform/graphics/Image.h" |
32 #include "platform/heap/Handle.h" | 32 #include "platform/heap/Handle.h" |
33 #include "platform/weborigin/KURL.h" | 33 #include "platform/weborigin/KURL.h" |
34 #include "third_party/skia/include/core/SkRefCnt.h" | 34 #include "third_party/skia/include/core/SkRefCnt.h" |
35 #include "wtf/Allocator.h" | 35 #include "wtf/Allocator.h" |
36 #include "wtf/WeakPtr.h" | |
36 | 37 |
37 namespace blink { | 38 namespace blink { |
38 | 39 |
39 class Document; | 40 class Document; |
40 class Page; | 41 class Page; |
41 class PaintController; | 42 class PaintController; |
42 class LayoutReplaced; | 43 class LayoutReplaced; |
43 class SVGImageChromeClient; | 44 class SVGImageChromeClient; |
44 class SVGImageForContainer; | 45 class SVGImageForContainer; |
45 | 46 |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
149 const FloatRect& fromRect, | 150 const FloatRect& fromRect, |
150 const FloatRect& toRect, | 151 const FloatRect& toRect, |
151 RespectImageOrientationEnum, | 152 RespectImageOrientationEnum, |
152 ImageClampingMode, | 153 ImageClampingMode, |
153 const KURL&); | 154 const KURL&); |
154 | 155 |
155 void stopAnimation(); | 156 void stopAnimation(); |
156 void scheduleTimelineRewind(); | 157 void scheduleTimelineRewind(); |
157 void flushPendingTimelineRewind(); | 158 void flushPendingTimelineRewind(); |
158 | 159 |
160 WTF::WeakPtr<SVGImage> asWeakPtr() { | |
161 return m_weakPtrFactory.createWeakPtr(); | |
162 } | |
163 | |
164 class SVGImageLocalFrameClient; | |
165 | |
159 Persistent<SVGImageChromeClient> m_chromeClient; | 166 Persistent<SVGImageChromeClient> m_chromeClient; |
160 Persistent<Page> m_page; | 167 Persistent<Page> m_page; |
161 std::unique_ptr<PaintController> m_paintController; | 168 std::unique_ptr<PaintController> m_paintController; |
162 | 169 |
163 // When an SVG image has no intrinsic size, the size depends on the default | 170 // When an SVG image has no intrinsic size, the size depends on the default |
164 // object size, which in turn depends on the container. One SVGImage may | 171 // object size, which in turn depends on the container. One SVGImage may |
165 // belong to multiple containers so the final image size can't be known in | 172 // belong to multiple containers so the final image size can't be known in |
166 // SVGImage. SVGImageForContainer carries the final image size, also called | 173 // SVGImage. SVGImageForContainer carries the final image size, also called |
167 // the "concrete object size". For more, see: SVGImageForContainer.h | 174 // the "concrete object size". For more, see: SVGImageForContainer.h |
168 IntSize m_intrinsicSize; | 175 IntSize m_intrinsicSize; |
169 bool m_hasPendingTimelineRewind; | 176 bool m_hasPendingTimelineRewind; |
177 | |
178 enum AsyncLoadCompletionStatus { | |
fs
2017/03/15 14:22:17
Why Async...? That's just one possible outcome.
hiroshige
2017/05/04 22:50:50
Done. Renamed to LoadState (and renamed some of en
| |
179 DataChangedNotStarted, | |
180 InDataChanged, | |
181 AfterDataChanged, | |
182 LoadCompletedWithinDataChanged, | |
183 LoadCompletedAsynchronously, | |
184 }; | |
185 | |
186 AsyncLoadCompletionStatus m_loadStatus = DataChangedNotStarted; | |
187 | |
188 WTF::WeakPtrFactory<SVGImage> m_weakPtrFactory; | |
170 }; | 189 }; |
171 | 190 |
172 DEFINE_IMAGE_TYPE_CASTS(SVGImage); | 191 DEFINE_IMAGE_TYPE_CASTS(SVGImage); |
173 | 192 |
174 class ImageObserverDisabler { | 193 class ImageObserverDisabler { |
175 STACK_ALLOCATED(); | 194 STACK_ALLOCATED(); |
176 WTF_MAKE_NONCOPYABLE(ImageObserverDisabler); | 195 WTF_MAKE_NONCOPYABLE(ImageObserverDisabler); |
177 | 196 |
178 public: | 197 public: |
179 ImageObserverDisabler(Image* image) : m_image(image) { | 198 ImageObserverDisabler(Image* image) : m_image(image) { |
180 m_image->setImageObserverDisabled(true); | 199 m_image->setImageObserverDisabled(true); |
181 } | 200 } |
182 | 201 |
183 ~ImageObserverDisabler() { m_image->setImageObserverDisabled(false); } | 202 ~ImageObserverDisabler() { m_image->setImageObserverDisabled(false); } |
184 | 203 |
185 private: | 204 private: |
186 Image* m_image; | 205 Image* m_image; |
187 }; | 206 }; |
188 | 207 |
189 } // namespace blink | 208 } // namespace blink |
190 | 209 |
191 #endif // SVGImage_h | 210 #endif // SVGImage_h |
OLD | NEW |