WebKit2 swipe gesture should report the position of the snapshot to the client
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 28 Aug 2014 01:23:52 +0000 (01:23 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 28 Aug 2014 01:23:52 +0000 (01:23 +0000)
commit81d4166aabcc1f6f6b2cc23e5573e06b3536d5ea
treee14062263a948ad02a2f99e4a048721184cda039
parentc52b8167a1429c7a5ce69b2a85cc7dafea8dd6f6
WebKit2 swipe gesture should report the position of the snapshot to the client
https://bugs.webkit.org/show_bug.cgi?id=136308
rdar://problem/18105827

Reviewed by Simon Fraser.

* UIProcess/API/Cocoa/WKViewPrivate.h:
* UIProcess/API/mac/WKView.mm:
(-[WKView _setDidMoveSwipeSnapshotCallback:]):
Add _setDidMoveSwipeSnapshotCallback, and plumb it to ViewGestureController.
Callers provide a block which is called whenever ViewGestureController moves the
swipe *snapshot* layer around.

* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.h:
* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::boundsOfLayerInLayerBackedWindowCoordinates):
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::boundsOfLayerInLayerBackedWindowCoordinates):
Expose a Mac-only way to get the bounds of a given CALayer in window coordinates,
respecting transforms. This only works for layer-backed windows because
it uses CA in order to do the mapping respecting transforms.

* UIProcess/mac/ViewGestureController.h:
* UIProcess/mac/ViewGestureControllerMac.mm:
(WebKit::ViewGestureController::ViewGestureController):
(WebKit::ViewGestureController::~ViewGestureController):
(WebKit::ViewGestureController::setDidMoveSwipeSnapshotCallback):
Do the Block_copy and Block_release dance to keep our copy of the callback block.

(WebKit::ViewGestureController::beginSwipeGesture):
(WebKit::ViewGestureController::handleSwipeGesture):
(WebKit::ViewGestureController::didMoveSwipeSnapshotLayer):
When the swipe snapshot layer moves around, call the block.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@173040 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/Cocoa/WKViewPrivate.h
Source/WebKit2/UIProcess/API/mac/WKView.mm
Source/WebKit2/UIProcess/PageClient.h
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/mac/PageClientImpl.h
Source/WebKit2/UIProcess/mac/PageClientImpl.mm
Source/WebKit2/UIProcess/mac/ViewGestureController.h
Source/WebKit2/UIProcess/mac/ViewGestureControllerMac.mm
Source/WebKit2/UIProcess/mac/WebPageProxyMac.mm