Changeset 88967 in webkit
- Timestamp:
- Jun 15, 2011 12:50:30 PM (13 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 1 deleted
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r88960 r88967 1 2011-06-15 Anders Carlsson <andersca@apple.com> 2 3 Reviewed by Darin Adler. 4 5 Add ShareableBitmap::createImage and get rid of WebCoreArgumentCodersCG.cpp 6 https://bugs.webkit.org/show_bug.cgi?id=62742 7 8 * Shared/ShareableBitmap.h: 9 Move createImage out of the #if PLATFORM(QT) section. 10 11 * Shared/WebCoreArgumentCoders.cpp: 12 (CoreIPC::decodeImage): 13 Call ShareableBitmap::createImage. 14 15 * Shared/WebCoreArgumentCoders.h: 16 remove createImage function declaration. 17 18 * Shared/cairo/ShareableBitmapCairo.cpp: 19 (WebKit::ShareableBitmap::createImage): 20 Add implementation. 21 22 * Shared/cg/ShareableBitmapCG.cpp: 23 (WebKit::ShareableBitmap::createGraphicsContext): 24 (WebKit::ShareableBitmap::createImage): 25 Move createImage implementation from WebCoreArgumentCodersCG.cpp here. 26 27 * WebKit2.xcodeproj/project.pbxproj: 28 * win/WebKit2.vcproj: 29 Update projects. 30 1 31 2011-06-15 Anders Carlsson <andersca@apple.com> 2 32 -
trunk/Source/WebKit2/Shared/ShareableBitmap.h
r88797 r88967 28 28 29 29 #include "SharedMemory.h" 30 #include <WebCore/Image.h>31 30 #include <WebCore/IntRect.h> 32 31 #include <wtf/PassOwnPtr.h> … … 48 47 49 48 namespace WebCore { 49 class Image; 50 50 class GraphicsContext; 51 51 } … … 108 108 bool isBackedBySharedMemory() const { return m_sharedMemory; } 109 109 110 // This creates a bitmap image that directly references the shared bitmap data. 111 // This is only safe to use when we know that the contents of the shareable bitmap won't change. 112 PassRefPtr<WebCore::Image> createImage(); 113 110 114 #if USE(CG) 111 115 // This creates a copied CGImageRef (most likely a copy-on-write) of the shareable bitmap. … … 123 127 // This is only safe to use when we know that the contents of the shareable bitmap won't change. 124 128 QImage createQImage(); 125 PassRefPtr<WebCore::Image> createImage();126 129 #endif 127 130 -
trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp
r88960 r88967 182 182 if (!bitmap) 183 183 return false; 184 image = createImage(bitmap.get());184 image = bitmap->createImage(); 185 185 if (!image) 186 186 return false; -
trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.h
r88960 r88967 142 142 void encodeImage(ArgumentEncoder*, WebCore::Image*); 143 143 bool decodeImage(ArgumentDecoder*, RefPtr<WebCore::Image>&); 144 RefPtr<WebCore::Image> createImage(WebKit::ShareableBitmap*);145 144 146 145 template<> struct ArgumentCoder<WebCore::Cursor> { -
trunk/Source/WebKit2/Shared/cairo/ShareableBitmapCairo.cpp
r87517 r88967 29 29 #include "ShareableBitmap.h" 30 30 31 #include <WebCore/BitmapImage.h> 31 32 #include <WebCore/CairoUtilities.h> 32 33 #include <WebCore/GraphicsContext.h> 33 #include <WebCore/NotImplemented.h>34 34 #include <WebCore/PlatformContextCairo.h> 35 35 … … 73 73 } 74 74 75 PassRefPtr<Image> ShareableBitmap::createImage() 76 { 77 RefPtr<cairo_surface_t> surface = createCairoSurface(); 78 if (!surface) 79 return 0; 80 81 // BitmapImage::create adopts the cairo_surface_t that's passed in, which is why we need to leakRef here. 82 return BitmapImage::create(surface.release().leakRef()); 83 } 84 75 85 } // namespace WebKit -
trunk/Source/WebKit2/Shared/cg/ShareableBitmapCG.cpp
r85754 r88967 27 27 #include "ShareableBitmap.h" 28 28 29 #include <WebCore/BitmapImage.h> 29 30 #include <WebCore/GraphicsContext.h> 30 31 #include <wtf/RetainPtr.h> … … 49 50 { 50 51 RetainPtr<CGColorSpaceRef> colorSpace(AdoptCF, CGColorSpaceCreateDeviceRGB()); 51 52 52 53 53 ref(); // Balanced by deref in releaseBitmapContextData. … … 107 107 } 108 108 109 PassRefPtr<Image> ShareableBitmap::createImage() 110 { 111 RetainPtr<CGImageRef> platformImage = makeCGImage(); 112 if (!platformImage) 113 return 0; 114 115 // BitmapImage::create adopts the CGImageRef that's passed in, which is why we need to leakRef here. 116 return BitmapImage::create(platformImage.leakRef()); 117 } 118 109 119 } // namespace WebKit -
trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
r88846 r88967 413 413 9391F2CB121B67AD00EBF7E8 /* WebFrameNetworkingContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 9391F283121B38F500EBF7E8 /* WebFrameNetworkingContext.h */; }; 414 414 939AE7661316E99C00AE06A6 /* WebCoreArgumentCoders.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 939AE7651316E99C00AE06A6 /* WebCoreArgumentCoders.cpp */; }; 415 939AE7681316E9AD00AE06A6 /* WebCoreArgumentCodersCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 939AE7671316E9AD00AE06A6 /* WebCoreArgumentCodersCG.cpp */; };416 415 93C01DAC139AC91700ED51D7 /* CoreIPCClientRunLoop.h in Headers */ = {isa = PBXBuildFile; fileRef = 93C01DAA139AC91700ED51D7 /* CoreIPCClientRunLoop.h */; }; 417 416 93C01DAD139AC91700ED51D7 /* CoreIPCClientRunLoop.mm in Sources */ = {isa = PBXBuildFile; fileRef = 93C01DAB139AC91700ED51D7 /* CoreIPCClientRunLoop.mm */; }; … … 1352 1351 9391F284121B38F500EBF7E8 /* WebFrameNetworkingContext.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebFrameNetworkingContext.mm; sourceTree = "<group>"; }; 1353 1352 939AE7651316E99C00AE06A6 /* WebCoreArgumentCoders.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebCoreArgumentCoders.cpp; sourceTree = "<group>"; }; 1354 939AE7671316E9AD00AE06A6 /* WebCoreArgumentCodersCG.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebCoreArgumentCodersCG.cpp; sourceTree = "<group>"; };1355 1353 93C01DAA139AC91700ED51D7 /* CoreIPCClientRunLoop.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreIPCClientRunLoop.h; sourceTree = "<group>"; }; 1356 1354 93C01DAB139AC91700ED51D7 /* CoreIPCClientRunLoop.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CoreIPCClientRunLoop.mm; sourceTree = "<group>"; }; … … 3254 3252 children = ( 3255 3253 C01A260012662F2100C9ED55 /* ShareableBitmapCG.cpp */, 3256 939AE7671316E9AD00AE06A6 /* WebCoreArgumentCodersCG.cpp */,3257 3254 ); 3258 3255 path = cg; … … 4441 4438 51A9E12A1315ED35009E7031 /* WebKeyValueStorageManagerProxyMessageReceiver.cpp in Sources */, 4442 4439 939AE7661316E99C00AE06A6 /* WebCoreArgumentCoders.cpp in Sources */, 4443 939AE7681316E9AD00AE06A6 /* WebCoreArgumentCodersCG.cpp in Sources */,4444 4440 330934471315B9220097A7BC /* WebCookieManagerMessageReceiver.cpp in Sources */, 4445 4441 330934491315B9220097A7BC /* WebCookieManagerProxyMessageReceiver.cpp in Sources */, -
trunk/Source/WebKit2/win/WebKit2.vcproj
r88846 r88967 1306 1306 </FileConfiguration> 1307 1307 </File> 1308 <File1309 RelativePath="..\Shared\cg\WebCoreArgumentCodersCG.cpp"1310 >1311 <FileConfiguration1312 Name="Debug_Cairo_CFLite|Win32"1313 ExcludedFromBuild="true"1314 >1315 <Tool1316 Name="VCCLCompilerTool"1317 />1318 </FileConfiguration>1319 <FileConfiguration1320 Name="Release_Cairo_CFLite|Win32"1321 ExcludedFromBuild="true"1322 >1323 <Tool1324 Name="VCCLCompilerTool"1325 />1326 </FileConfiguration>1327 </File>1328 1308 <Filter 1329 1309 Name="win"
Note: See TracChangeset
for help on using the changeset viewer.