Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(713)

Side by Side Diff: third_party/WebKit/Source/platform/graphics/Image.h

Issue 2613853002: Phase III Step 2: Call imageNotifyFinished() and image load event after SVG loading completes (Closed)
Patch Set: Rebase Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) 2 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
3 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006 Apple Computer, 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 94
95 virtual bool usesContainerSize() const { return false; } 95 virtual bool usesContainerSize() const { return false; }
96 virtual bool hasRelativeSize() const { return false; } 96 virtual bool hasRelativeSize() const { return false; }
97 97
98 virtual IntSize size() const = 0; 98 virtual IntSize size() const = 0;
99 IntRect rect() const { return IntRect(IntPoint(), size()); } 99 IntRect rect() const { return IntRect(IntPoint(), size()); }
100 int width() const { return size().width(); } 100 int width() const { return size().width(); }
101 int height() const { return size().height(); } 101 int height() const { return size().height(); }
102 virtual bool getHotSpot(IntPoint&) const { return false; } 102 virtual bool getHotSpot(IntPoint&) const { return false; }
103 103
104 enum SizeAvailability { SizeAvailable, SizeUnavailable }; 104 enum SizeAvailability {
105 SizeAvailable,
106 SizeUnavailable,
107 SizeAvailableAndLoadingAsynchronously
108 };
109
110 // If setData() returns |SizeAvailableAndLoadingAsynchronously|:
111 // Image loading is continuing asynchronously
112 // (only when |this| is SVGImage and |allDataReceived| is true), and
113 // ImageResourceObserver::loadCompleted() is called when finished.
114 // Otherwise:
115 // Image loading is completed synchronously.
116 // ImageResourceObserver::loadCompleted() is not called.
105 virtual SizeAvailability setData(PassRefPtr<SharedBuffer> data, 117 virtual SizeAvailability setData(PassRefPtr<SharedBuffer> data,
106 bool allDataReceived); 118 bool allDataReceived);
107 virtual SizeAvailability dataChanged(bool /*allDataReceived*/) { 119 virtual SizeAvailability dataChanged(bool /*allDataReceived*/) {
108 return SizeUnavailable; 120 return SizeUnavailable;
109 } 121 }
110 122
111 virtual String filenameExtension() const { 123 virtual String filenameExtension() const {
112 return String(); 124 return String();
113 } // null string if unknown 125 } // null string if unknown
114 126
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 bool m_imageObserverDisabled; 231 bool m_imageObserverDisabled;
220 }; 232 };
221 233
222 #define DEFINE_IMAGE_TYPE_CASTS(typeName) \ 234 #define DEFINE_IMAGE_TYPE_CASTS(typeName) \
223 DEFINE_TYPE_CASTS(typeName, Image, image, image->is##typeName(), \ 235 DEFINE_TYPE_CASTS(typeName, Image, image, image->is##typeName(), \
224 image.is##typeName()) 236 image.is##typeName())
225 237
226 } // namespace blink 238 } // namespace blink
227 239
228 #endif 240 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698