Changeset 83091 in webkit
- Timestamp:
- Apr 6, 2011 1:31:39 PM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r83090 r83091 1 2011-04-06 Brady Eidson <beidson@apple.com> 2 3 Reviewed by Anders Carlsson. 4 5 https://bugs.webkit.org/show_bug.cgi?id=57973 and https://bugs.webkit.org/show_bug.cgi?id=57973 6 WK2 icon database should be able to get a CGImage of a specific size 7 8 * platform/graphics/BitmapImage.h: 9 * platform/graphics/Image.h: 10 (WebCore::Image::getFirstCGImageRefOfSize): 11 12 * platform/graphics/cg/ImageCG.cpp: 13 (WebCore::BitmapImage::getFirstCGImageRefOfSize): Walk the frames of the image until reaching the 14 first frame of the requested size. 15 1 16 2011-04-06 Malcolm MacLeod <malcolm.macleod@tshwanedje.com> 2 17 -
trunk/Source/WebCore/platform/graphics/BitmapImage.h
r82728 r83091 142 142 #if PLATFORM(CG) 143 143 virtual CGImageRef getCGImageRef(); 144 virtual CGImageRef getFirstCGImageRefOfSize(const IntSize&); 144 145 #endif 145 146 -
trunk/Source/WebCore/platform/graphics/Image.h
r65449 r83091 139 139 #if PLATFORM(CG) 140 140 virtual CGImageRef getCGImageRef() { return 0; } 141 virtual CGImageRef getFirstCGImageRefOfSize(const IntSize&) { return 0; } 141 142 #endif 142 143 -
trunk/Source/WebCore/platform/graphics/cg/ImageCG.cpp
r77286 r83091 155 155 } 156 156 157 CGImageRef BitmapImage::getFirstCGImageRefOfSize(const IntSize& size) 158 { 159 for (size_t i = 0; i < m_frames.size(); ++i) { 160 CGImageRef cgImage = frameAtIndex(i); 161 if (IntSize(CGImageGetWidth(cgImage), CGImageGetHeight(cgImage)) == size) 162 return cgImage; 163 } 164 165 // Fallback to the default CGImageRef if we can't find the right size 166 return getCGImageRef(); 167 } 168 157 169 void BitmapImage::draw(GraphicsContext* ctxt, const FloatRect& destRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator compositeOp) 158 170 { -
trunk/Source/WebKit2/ChangeLog
r83085 r83091 1 2011-04-06 Brady Eidson <beidson@apple.com> 2 3 Reviewed by Anders Carlsson. 4 5 https://bugs.webkit.org/show_bug.cgi?id=57973 and https://bugs.webkit.org/show_bug.cgi?id=57973 6 WK2 icon database should be able to get a CGImage of a specific size 7 8 * UIProcess/API/C/cg/WKIconDatabaseCG.cpp: 9 (WKIconDatabaseTryGetCGImageForURL): Change this API to take a requested size, and find the first matching 10 CGImage in the icon. 11 * UIProcess/API/C/cg/WKIconDatabaseCG.h: 12 1 13 2011-04-06 Jessie Berlin <jberlin@apple.com> 2 14 -
trunk/Source/WebKit2/UIProcess/API/C/cg/WKIconDatabaseCG.cpp
r82839 r83091 35 35 using namespace WebCore; 36 36 37 CGImageRef WKIconDatabaseTryGetCGImageForURL(WKIconDatabaseRef iconDatabaseRef, WKURLRef urlRef )37 CGImageRef WKIconDatabaseTryGetCGImageForURL(WKIconDatabaseRef iconDatabaseRef, WKURLRef urlRef, WKSize size) 38 38 { 39 39 Image* image = toImpl(iconDatabaseRef)->imageForPageURL(toWTFString(urlRef)); 40 return image ? image->get CGImageRef() : 0;40 return image ? image->getFirstCGImageRefOfSize(IntSize(static_cast<int>(size.width), static_cast<int>(size.height))) : 0; 41 41 } -
trunk/Source/WebKit2/UIProcess/API/C/cg/WKIconDatabaseCG.h
r82839 r83091 29 29 #include <CoreGraphics/CGImage.h> 30 30 #include <WebKit2/WKBase.h> 31 #include <WebKit2/WKGeometry.h> 31 32 32 33 #ifdef __cplusplus … … 34 35 #endif 35 36 36 WK_EXPORT CGImageRef WKIconDatabaseTryGetCGImageForURL(WKIconDatabaseRef iconDatabase, WKURLRef urlString );37 WK_EXPORT CGImageRef WKIconDatabaseTryGetCGImageForURL(WKIconDatabaseRef iconDatabase, WKURLRef urlString, WKSize size); 37 38 38 39 #ifdef __cplusplus
Note: See TracChangeset
for help on using the changeset viewer.