Handle cases when IOSurface initialization fails.
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 23 Jul 2016 01:56:28 +0000 (01:56 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 23 Jul 2016 01:56:28 +0000 (01:56 +0000)
commitc235531e11442d7536a05bc008527eeb6f6a65b5
treec0b697b91bec478defe1f7e11c542d8c4ab16abe
parentd91b3d5fd93d15b7c1cf4f698b453262952aacff
Handle cases when IOSurface initialization fails.
https://bugs.webkit.org/show_bug.cgi?id=160006
<rdar://problem/27495102>

Reviewed by Tim Horton and Simon Fraser.

This is an additional fix to r203514 to check if IOSurface initialization was successful.

Unable to test.

Source/WebCore:

* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::ImageBuffer::ImageBuffer):
* platform/graphics/cocoa/IOSurface.h: Merge 2 c'tors.
* platform/graphics/cocoa/IOSurface.mm: Remove redundant IOSurface::create() code.
(WebCore::IOSurface::create):
(WebCore::IOSurface::createFromImage):
(WebCore::IOSurface::IOSurface):
(WebCore::IOSurface::convertToFormat):

Source/WebKit2:

* Shared/mac/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStore::encode):
(WebKit::RemoteLayerBackingStore::display):
(WebKit::RemoteLayerBackingStore::applyBackingStoreToLayer):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _takeViewSnapshot]):
(-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@203631 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp
Source/WebCore/platform/graphics/cocoa/IOSurface.h
Source/WebCore/platform/graphics/cocoa/IOSurface.mm
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/mac/RemoteLayerBackingStore.mm
Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm