Chromium Code Reviews| 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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 176 PaintFlags&, | 176 PaintFlags&, |
| 177 const SkMatrix& local_matrix); | 177 const SkMatrix& local_matrix); |
| 178 bool ApplyShaderInternal(PaintFlags&, | 178 bool ApplyShaderInternal(PaintFlags&, |
| 179 const SkMatrix& local_matrix, | 179 const SkMatrix& local_matrix, |
| 180 const KURL&); | 180 const KURL&); |
| 181 | 181 |
| 182 void StopAnimation(); | 182 void StopAnimation(); |
| 183 void ScheduleTimelineRewind(); | 183 void ScheduleTimelineRewind(); |
| 184 void FlushPendingTimelineRewind(); | 184 void FlushPendingTimelineRewind(); |
| 185 | 185 |
| 186 Page* GetPage() { return page_; } | |
|
fs
2017/05/17 11:14:45
Nit: GetPageForTesting to avoid given people wrong
chrishtr
2017/05/17 17:01:18
Done.
| |
| 186 void LoadCompleted(); | 187 void LoadCompleted(); |
| 187 | 188 |
| 188 class SVGImageLocalFrameClient; | 189 class SVGImageLocalFrameClient; |
| 189 | 190 |
| 190 Persistent<SVGImageChromeClient> chrome_client_; | 191 Persistent<SVGImageChromeClient> chrome_client_; |
| 191 Persistent<Page> page_; | 192 Persistent<Page> page_; |
| 192 std::unique_ptr<PaintController> paint_controller_; | 193 std::unique_ptr<PaintController> paint_controller_; |
| 193 | 194 |
| 194 // When an SVG image has no intrinsic size, the size depends on the default | 195 // When an SVG image has no intrinsic size, the size depends on the default |
| 195 // object size, which in turn depends on the container. One SVGImage may | 196 // object size, which in turn depends on the container. One SVGImage may |
| 196 // belong to multiple containers so the final image size can't be known in | 197 // belong to multiple containers so the final image size can't be known in |
| 197 // SVGImage. SVGImageForContainer carries the final image size, also called | 198 // SVGImage. SVGImageForContainer carries the final image size, also called |
| 198 // the "concrete object size". For more, see: SVGImageForContainer.h | 199 // the "concrete object size". For more, see: SVGImageForContainer.h |
| 199 IntSize intrinsic_size_; | 200 IntSize intrinsic_size_; |
| 200 bool has_pending_timeline_rewind_; | 201 bool has_pending_timeline_rewind_; |
| 201 | 202 |
| 202 enum LoadState { | 203 enum LoadState { |
| 203 kDataChangedNotStarted, | 204 kDataChangedNotStarted, |
| 204 kInDataChanged, | 205 kInDataChanged, |
| 205 kWaitingForAsyncLoadCompletion, | 206 kWaitingForAsyncLoadCompletion, |
| 206 kLoadCompleted, | 207 kLoadCompleted, |
| 207 }; | 208 }; |
| 208 | 209 |
| 209 LoadState load_state_ = kDataChangedNotStarted; | 210 LoadState load_state_ = kDataChangedNotStarted; |
| 210 | 211 |
| 211 Persistent<SVGImageLocalFrameClient> frame_client_; | 212 Persistent<SVGImageLocalFrameClient> frame_client_; |
| 213 FRIEND_TEST_ALL_PREFIXES(SVGImageTest, SupportsSubsequenceCaching); | |
| 212 }; | 214 }; |
| 213 | 215 |
| 214 DEFINE_IMAGE_TYPE_CASTS(SVGImage); | 216 DEFINE_IMAGE_TYPE_CASTS(SVGImage); |
| 215 | 217 |
| 216 class ImageObserverDisabler { | 218 class ImageObserverDisabler { |
| 217 STACK_ALLOCATED(); | 219 STACK_ALLOCATED(); |
| 218 WTF_MAKE_NONCOPYABLE(ImageObserverDisabler); | 220 WTF_MAKE_NONCOPYABLE(ImageObserverDisabler); |
| 219 | 221 |
| 220 public: | 222 public: |
| 221 ImageObserverDisabler(Image* image) : image_(image) { | 223 ImageObserverDisabler(Image* image) : image_(image) { |
| 222 image_->SetImageObserverDisabled(true); | 224 image_->SetImageObserverDisabled(true); |
| 223 } | 225 } |
| 224 | 226 |
| 225 ~ImageObserverDisabler() { image_->SetImageObserverDisabled(false); } | 227 ~ImageObserverDisabler() { image_->SetImageObserverDisabled(false); } |
| 226 | 228 |
| 227 private: | 229 private: |
| 228 Image* image_; | 230 Image* image_; |
| 229 }; | 231 }; |
| 230 | 232 |
| 231 } // namespace blink | 233 } // namespace blink |
| 232 | 234 |
| 233 #endif // SVGImage_h | 235 #endif // SVGImage_h |
| OLD | NEW |