Use IOSurface ViewSnapshots everywhere on Mac, remove JPEG encoding path
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 9 Jul 2014 19:31:33 +0000 (19:31 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 9 Jul 2014 19:31:33 +0000 (19:31 +0000)
commit6b802c069d07ed4788a66cf13011ea224f973323
treeb7327c2856dbdef01c74fdc8f58d3a4ce14a994e
parent9d5fd96a42152ecb9c8af03f62ca17f4be75dada
Use IOSurface ViewSnapshots everywhere on Mac, remove JPEG encoding path
https://bugs.webkit.org/show_bug.cgi?id=134773

Reviewed by Anders Carlsson.

* UIProcess/API/mac/WKView.mm:
(-[WKView _takeViewSnapshot]):
* UIProcess/mac/ViewSnapshotStore.h:
* UIProcess/mac/ViewSnapshotStore.mm:
(WebKit::ViewSnapshotStore::ViewSnapshotStore):
(WebKit::ViewSnapshotStore::~ViewSnapshotStore):
(WebKit::ViewSnapshotStore::recordSnapshot):
(WebKit::ViewSnapshot::clearImage):
(WebKit::ViewSnapshot::asLayerContents):
(WebKit::createIOSurfaceFromImage): Deleted.
(WebKit::compressImageAsJPEG): Deleted.
(WebKit::ViewSnapshotStore::reduceSnapshotMemoryCost): Deleted.
(WebKit::ViewSnapshotStore::didCompressSnapshot): Deleted.
Remove all ViewSnapshot(Store) code related to JPEG-encoded snapshots.
Remove the "image" member on ViewSnapshot; Mac will always start out with an IOSurface instead.
Adopt WebCore::IOSurface::createFromImage to make that happen.
Add a comment noting that if a snapshot comes back empty, we should throw it away completely.

* WebCore.exp.in:
* platform/graphics/cocoa/IOSurface.h:
* platform/graphics/cocoa/IOSurface.mm:
(IOSurface::createFromImage):
Move make-an-IOSurface-from-a-CGImageRef into WebCore::IOSurface.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@170925 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/platform/graphics/cocoa/IOSurface.h
Source/WebCore/platform/graphics/cocoa/IOSurface.mm
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/mac/WKView.mm
Source/WebKit2/UIProcess/mac/ViewSnapshotStore.h
Source/WebKit2/UIProcess/mac/ViewSnapshotStore.mm