Changeset 85697 in webkit
- Timestamp:
- May 3, 2011 5:38:54 PM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r85695 r85697 1 2011-05-03 Brady Eidson <beidson@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 https://bugs.webkit.org/show_bug.cgi?id=60087 and <rdar://problem/9373182> 6 WK2 Icon Database should provide access to all image representations in the icon. 7 8 Add an accessor for CG platforms to get a CFArrayRef of all the CGImageRefs represented: 9 * platform/graphics/BitmapImage.h: 10 * platform/graphics/Image.h: 11 (WebCore::Image::getCGImageArray): 12 * platform/graphics/cg/ImageCG.cpp: 13 (WebCore::BitmapImage::getCGImageArray): 14 1 15 2011-05-03 Ryosuke Niwa <rniwa@webkit.org> 2 16 -
trunk/Source/WebCore/platform/graphics/BitmapImage.h
r84321 r85697 143 143 virtual CGImageRef getCGImageRef(); 144 144 virtual CGImageRef getFirstCGImageRefOfSize(const IntSize&); 145 virtual RetainPtr<CFArrayRef> getCGImageArray(); 145 146 #endif 146 147 -
trunk/Source/WebCore/platform/graphics/Image.h
r84101 r85697 37 37 #include <wtf/RefCounted.h> 38 38 #include <wtf/RefPtr.h> 39 #include <wtf/RetainPtr.h> 39 40 40 41 #if PLATFORM(MAC) … … 140 141 virtual CGImageRef getCGImageRef() { return 0; } 141 142 virtual CGImageRef getFirstCGImageRefOfSize(const IntSize&) { return 0; } 143 virtual RetainPtr<CFArrayRef> getCGImageArray() { return 0; } 142 144 #endif 143 145 -
trunk/Source/WebCore/platform/graphics/cg/ImageCG.cpp
r85036 r85697 37 37 #include "PlatformString.h" 38 38 #include <ApplicationServices/ApplicationServices.h> 39 #include <CoreFoundation/CFArray.h> 39 40 #include <wtf/RetainPtr.h> 40 41 … … 168 169 } 169 170 171 RetainPtr<CFArrayRef> BitmapImage::getCGImageArray() 172 { 173 size_t count = frameCount(); 174 if (!count) 175 return 0; 176 177 CFMutableArrayRef array = CFArrayCreateMutable(NULL, count, &kCFTypeArrayCallBacks); 178 for (size_t i = 0; i < count; ++i) 179 CFArrayAppendValue(array, frameAtIndex(i)); 180 181 return RetainPtr<CFArrayRef>(AdoptCF, array); 182 } 183 170 184 void BitmapImage::draw(GraphicsContext* ctxt, const FloatRect& destRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator compositeOp) 171 185 { -
trunk/Source/WebKit2/ChangeLog
r85689 r85697 1 2011-05-03 Brady Eidson <beidson@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 https://bugs.webkit.org/show_bug.cgi?id=60087 and <rdar://problem/9373182> 6 WK2 Icon Database should provide access to all image representations in the icon. 7 8 Expose a CFArrayRef of CGImageRefs as API for CG platforms: 9 * UIProcess/API/C/cg/WKIconDatabaseCG.cpp: 10 (WKIconDatabaseTryCopyCGImageArrayForURL): 11 * UIProcess/API/C/cg/WKIconDatabaseCG.h: 12 1 13 2011-05-03 Sam Weinig <sam@webkit.org> 2 14 -
trunk/Source/WebKit2/UIProcess/API/C/cg/WKIconDatabaseCG.cpp
r83091 r85697 40 40 return image ? image->getFirstCGImageRefOfSize(IntSize(static_cast<int>(size.width), static_cast<int>(size.height))) : 0; 41 41 } 42 43 CFArrayRef WKIconDatabaseTryCopyCGImageArrayForURL(WKIconDatabaseRef iconDatabaseRef, WKURLRef urlRef) 44 { 45 Image* image = toImpl(iconDatabaseRef)->imageForPageURL(toWTFString(urlRef)); 46 return image ? image->getCGImageArray().leakRef() : 0; 47 } 48 -
trunk/Source/WebKit2/UIProcess/API/C/cg/WKIconDatabaseCG.h
r83091 r85697 27 27 #define WKIconDatabaseCG_h 28 28 29 #include <CoreFoundation/CFArray.h> 29 30 #include <CoreGraphics/CGImage.h> 30 31 #include <WebKit2/WKBase.h> … … 35 36 #endif 36 37 37 WK_EXPORT CGImageRef WKIconDatabaseTryGetCGImageForURL(WKIconDatabaseRef iconDatabase, WKURLRef urlString, WKSize size); 38 WK_EXPORT CGImageRef WKIconDatabaseTryGetCGImageForURL(WKIconDatabaseRef iconDatabase, WKURLRef url, WKSize size); 39 WK_EXPORT CFArrayRef WKIconDatabaseTryCopyCGImageArrayForURL(WKIconDatabaseRef iconDatabase, WKURLRef url); 38 40 39 41 #ifdef __cplusplus
Note: See TracChangeset
for help on using the changeset viewer.