Bug 77804

Summary: [chromium] Add support for pinch gesture in the threaded compositor
Product: WebKit Reporter: Sadrul Habib Chowdhury <sadrul>
Component: WebKit Misc.Assignee: Sadrul Habib Chowdhury <sadrul>
Status: RESOLVED FIXED    
Severity: Normal CC: fishd, jamesr, rgbbones, rjkroege, webkit.review.bot, wjmaclean
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch none

Sadrul Habib Chowdhury
Reported 2012-02-03 21:07:33 PST
The threaded compositor currently does not support pinch gestures. This patch adds that support.
Attachments
Patch (4.37 KB, patch)
2012-02-03 21:11 PST, Sadrul Habib Chowdhury
no flags
Patch (5.26 KB, patch)
2012-02-03 21:19 PST, Sadrul Habib Chowdhury
no flags
Patch (5.41 KB, patch)
2012-02-03 21:25 PST, Sadrul Habib Chowdhury
no flags
Patch (5.39 KB, patch)
2012-02-03 21:35 PST, Sadrul Habib Chowdhury
no flags
Patch (11.14 KB, patch)
2012-02-07 13:07 PST, Sadrul Habib Chowdhury
no flags
Patch (11.15 KB, patch)
2012-02-08 10:24 PST, Sadrul Habib Chowdhury
no flags
Patch (11.43 KB, patch)
2012-02-08 12:16 PST, Sadrul Habib Chowdhury
no flags
Patch (1.24 KB, patch)
2012-02-08 18:34 PST, Raymond
no flags
Sadrul Habib Chowdhury
Comment 1 2012-02-03 21:11:18 PST
WebKit Review Bot
Comment 2 2012-02-03 21:13:26 PST
Please wait for approval from fishd@chromium.org before submitting because this patch contains changes to the Chromium public API.
Darin Fisher (:fishd, Google)
Comment 3 2012-02-03 21:17:07 PST
Comment on attachment 125475 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=125475&action=review > Source/WebKit/chromium/src/WebInputEventConversion.cpp:161 > + ASSERT_NOT_REACHED(); should this have a FIXME too about PlatformGestureEvent?
Sadrul Habib Chowdhury
Comment 4 2012-02-03 21:19:03 PST
Sadrul Habib Chowdhury
Comment 5 2012-02-03 21:25:49 PST
Sadrul Habib Chowdhury
Comment 6 2012-02-03 21:26:24 PST
Comment on attachment 125475 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=125475&action=review >> Source/WebKit/chromium/src/WebInputEventConversion.cpp:161 >> + ASSERT_NOT_REACHED(); > > should this have a FIXME too about PlatformGestureEvent? Good point. Added.
Sadrul Habib Chowdhury
Comment 7 2012-02-03 21:35:54 PST
Sadrul Habib Chowdhury
Comment 8 2012-02-03 21:37:05 PST
A quick explanation: the approach in this patch is very simple: it simply adds the necessary enums for pinch-gestures, and processes them appropriately from the threaded compositor. Unlike scroll-gesture events, the compositor always processes the pinch-gestures, and so the pinches don't reach the main thread. When not using the MT compositor, I have added checks in the appropriate places (WebViewImpl, WebPopupMenuImpl) so that the events are ignored. I am not entirely sure if pinch should do anything when the compositor isn't used. Also, it would require updating PlatformGestureEvent. So I have kept that for a separate CL. Does that sound good?
Sadrul Habib Chowdhury
Comment 9 2012-02-07 13:07:02 PST
Robert Kroeger
Comment 10 2012-02-07 16:00:29 PST
it looks reasonable to me.
Sadrul Habib Chowdhury
Comment 11 2012-02-08 10:24:03 PST
Darin Fisher (:fishd, Google)
Comment 12 2012-02-08 11:12:49 PST
Comment on attachment 126109 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=126109&action=review LGTM, but... > Source/WebKit/chromium/public/WebInputEvent.h:112 > + GesturePinchBegin, OK > Source/WebKit/chromium/src/WebCompositorInputHandlerImpl.cpp:177 > + } else if (event.type == WebInputEvent::GesturePinchBegin) { jamesr should probably review this part and the test.
James Robinson
Comment 13 2012-02-08 11:58:02 PST
Comment on attachment 126109 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=126109&action=review R=me with one request for documentation and one very minor style nit. > Source/WebKit/chromium/src/WebCompositorInputHandlerImpl.cpp:196 > + m_inputHandlerClient->pinchGestureUpdate(gestureEvent.deltaX, IntPoint(gestureEvent.x, gestureEvent.y)); I suppose this means that pinches are 1-dimensional and we're using deltaX to represent the amount - could you please document this somewhere (such as in WebInputEvent where it defines WebGestureEvent)? > Source/WebKit/chromium/tests/WebCompositorInputHandlerImplTest.cpp:252 > + gesture.deltaX = 1.5f; don't put the trailing "f" on this. see "Floating point literals" in http://www.webkit.org/coding/coding-style.html
Sadrul Habib Chowdhury
Comment 14 2012-02-08 12:16:00 PST
Sadrul Habib Chowdhury
Comment 15 2012-02-08 12:27:56 PST
Comment on attachment 126109 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=126109&action=review >> Source/WebKit/chromium/src/WebCompositorInputHandlerImpl.cpp:196 >> + m_inputHandlerClient->pinchGestureUpdate(gestureEvent.deltaX, IntPoint(gestureEvent.x, gestureEvent.y)); > > I suppose this means that pinches are 1-dimensional and we're using deltaX to represent the amount - could you please document this somewhere (such as in WebInputEvent where it defines WebGestureEvent)? Indeed; we do use deltaX to represent the scaling/magnification amount. I have added a comment explaining this in WebInputEvent.h >> Source/WebKit/chromium/tests/WebCompositorInputHandlerImplTest.cpp:252 >> + gesture.deltaX = 1.5f; > > don't put the trailing "f" on this. see "Floating point literals" in http://www.webkit.org/coding/coding-style.html Fixed.
James Robinson
Comment 16 2012-02-08 12:31:09 PST
Comment on attachment 126132 [details] Patch Cool.
WebKit Review Bot
Comment 17 2012-02-08 13:13:16 PST
Comment on attachment 126132 [details] Patch Clearing flags on attachment: 126132 Committed r107125: <http://trac.webkit.org/changeset/107125>
WebKit Review Bot
Comment 18 2012-02-08 13:13:20 PST
All reviewed patches have been landed. Closing bug.
Raymond
Comment 19 2012-02-08 18:12:12 PST
Comment on attachment 126132 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=126132&action=review buid failed on my machine due to gcc warnning. > Source/WebKit/chromium/tests/WebCompositorInputHandlerImplTest.cpp:64 > + m_pinchStarted = m_pinchStarted = false; I guess this should be m_pinchStarted = m_pinchEnded = false;
Raymond
Comment 20 2012-02-08 18:22:41 PST
Reopening to attach new patch.
Raymond
Comment 21 2012-02-08 18:34:50 PST
James Robinson
Comment 22 2012-02-08 20:06:08 PST
Comment on attachment 126215 [details] Patch Thanks, Raymond. I think you are completely right.
Sadrul Habib Chowdhury
Comment 23 2012-02-08 20:37:08 PST
(In reply to comment #21) > Created an attachment (id=126215) [details] > Patch Whoops! Thanks for catching this!
WebKit Review Bot
Comment 24 2012-02-08 23:52:52 PST
Comment on attachment 126215 [details] Patch Clearing flags on attachment: 126215 Committed r107187: <http://trac.webkit.org/changeset/107187>
WebKit Review Bot
Comment 25 2012-02-08 23:52:59 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.