Avoid re-encoding action menu image data
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Nov 2014 22:54:52 +0000 (22:54 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Nov 2014 22:54:52 +0000 (22:54 +0000)
commit1396d68373b7baa74e8e2eca8dfa302baaed207c
tree5eaa7cc68630b00c76ac7729a2932a6a38759a25
parentd0963167e9377cca110bd12acfd901bb8ef1cab2
Avoid re-encoding action menu image data
https://bugs.webkit.org/show_bug.cgi?id=138817
<rdar://problem/18840382>

Reviewed by Anders Carlsson.

* Shared/mac/ActionMenuHitTestResult.h:
* Shared/mac/ActionMenuHitTestResult.mm:
(WebKit::ActionMenuHitTestResult::encode):
(WebKit::ActionMenuHitTestResult::decode):
Store and encode a SharedMemory with the raw encoded image data,
instead of re-painting the image into a ShareableBitmap.

* UIProcess/mac/WKActionMenuController.mm:
(-[WKActionMenuController _hitTestResultImage]):
(-[WKActionMenuController _defaultMenuItemsForImage]):
(-[WKActionMenuController _copyImage:]):
(-[WKActionMenuController _addImageToPhotos:]):
(-[WKActionMenuController _defaultMenuItems]):
(-[WKActionMenuController _canAddMediaToPhotos]): Deleted.
Build a temporary filename from a UUID and the image's desired extension.
Use the Image's encoded data instead of re-encoding it with CGImageDestination.
Build an image menu only if we have an image, URL, data, and extension.

* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::performActionMenuHitTestAtLocation):

* WebView/WebActionMenuController.mm:
(-[WebActionMenuController _defaultMenuItemsForImage:]):
(-[WebActionMenuController _addImageToPhotos:]):
Build a temporary filename from a UUID and the image's desired extension.
Use the Image's encoded data instead of re-encoding it with CGImageDestination.
Build an image menu only if we have an image, URL, data, and extension.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@176288 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebActionMenuController.mm
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/mac/ActionMenuHitTestResult.h
Source/WebKit2/Shared/mac/ActionMenuHitTestResult.mm
Source/WebKit2/UIProcess/mac/WKActionMenuController.mm
Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm