|
|
Created:
4 years ago by denniskempin Modified:
4 years ago CC:
chromium-reviews, jdufault Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
Descriptionexo: Implement v6 of touch protocol including shape and frame event
This is a prerequisite for passing along pen information via touch
events.
Ideally we want to batch multiple touch updates of a single hardware
event together with a single frame event. However this will need
an extension of ui::TouchEvents. We still provide a valid implementation
of wl_touch by sending a frame for every updated touch separately.
BUG=665499
TEST=Updated unit tests
Committed: https://crrev.com/f4361e3208bca8ab2a5a8a2cc1af1b04602fdf2e
Cr-Commit-Position: refs/heads/master@{#438908}
Patch Set 1 #Patch Set 2 : only report major/minor when changed #Patch Set 3 : extend event_generator to test touch radius #
Total comments: 8
Patch Set 4 : Always send shape update #
Total comments: 3
Patch Set 5 : fixed nits #Patch Set 6 : Fixed pen pointer mode conflict after rebase #
Dependent Patchsets: Messages
Total messages: 55 (26 generated)
denniskempin@google.com changed reviewers: + reveman@chromium.org
PTAL. To implement the zcr_stylus_v2 protocol we need to properly implement the frame event. And while we are at it, should implement the touch shape as well to have a full implementation of the latest wl_touch protocol.
denniskempin@google.com changed reviewers: + sadrul@chromium.org
Hi Sadrul! Writing some exo unittests I have made some useful extension to EventGenerator to help testing touch events with pointer details. Could you have a look or let me know who could review this? You seem to be the only direct owner of ui/events.
https://codereview.chromium.org/2560633002/diff/40001/components/exo/touch.cc File components/exo/touch.cc (right): https://codereview.chromium.org/2560633002/diff/40001/components/exo/touch.cc... components/exo/touch.cc:20: static bool AlmostEqual(T x, T y) { This would need some explaining and maybe a rename to TouchAxisAlmostEqual. But first, do we really need this? Sending a Touch::OnTouchShape event for every touch event would be so much easier and it doesn't seem like that would add any significant overhead. Am I missing something here? https://codereview.chromium.org/2560633002/diff/40001/components/exo/touch_de... File components/exo/touch_delegate.h (right): https://codereview.chromium.org/2560633002/diff/40001/components/exo/touch_de... components/exo/touch_delegate.h:47: // Called when a touch point has changed it's shape. s/it's/its/
lgtm https://codereview.chromium.org/2560633002/diff/40001/ui/events/test/event_ge... File ui/events/test/event_generator.cc (right): https://codereview.chromium.org/2560633002/diff/40001/ui/events/test/event_ge... ui/events/test/event_generator.cc:270: pen_pointer_mode_ = true; Should these be updated?
https://codereview.chromium.org/2560633002/diff/40001/components/exo/touch.cc File components/exo/touch.cc (right): https://codereview.chromium.org/2560633002/diff/40001/components/exo/touch.cc... components/exo/touch.cc:20: static bool AlmostEqual(T x, T y) { On 2016/12/07 03:16:18, reveman wrote: > This would need some explaining and maybe a rename to TouchAxisAlmostEqual. But > first, do we really need this? Sending a Touch::OnTouchShape event for every > touch event would be so much easier and it doesn't seem like that would add any > significant overhead. Am I missing something here? We don't really have to do this, but the protocol asks for those events to be only sent when the shape is changing, much like mouse events are only sent when the location is changing. We will have more fields here where we will apply the same pattern. Tilt and force as well. So at that time we would be at up to 4 events (shape, tilt, force, motion) for every update, so the overhead will be increasing. Either way, I think it would be fully functional with little overhead if we just send those events for every update. I am just following the practice we were using in the Pointer class. AlmostEqual is really just a generic function to compare to floating point values for equality since you cannot compare them directly. So maybe FloatAlmostEqual would be more fitting? https://codereview.chromium.org/2560633002/diff/40001/ui/events/test/event_ge... File ui/events/test/event_generator.cc (right): https://codereview.chromium.org/2560633002/diff/40001/ui/events/test/event_ge... ui/events/test/event_generator.cc:270: pen_pointer_mode_ = true; On 2016/12/07 18:00:19, sadrul wrote: > Should these be updated? These are used on mouse pen events only, so they are separate from the touch_pointer_details.
https://codereview.chromium.org/2560633002/diff/40001/components/exo/touch.cc File components/exo/touch.cc (right): https://codereview.chromium.org/2560633002/diff/40001/components/exo/touch.cc... components/exo/touch.cc:20: static bool AlmostEqual(T x, T y) { On 2016/12/07 at 18:32:18, denniskempin wrote: > On 2016/12/07 03:16:18, reveman wrote: > > This would need some explaining and maybe a rename to TouchAxisAlmostEqual. But > > first, do we really need this? Sending a Touch::OnTouchShape event for every > > touch event would be so much easier and it doesn't seem like that would add any > > significant overhead. Am I missing something here? > > We don't really have to do this, but the protocol asks for those events to be only sent when the shape is changing, much like mouse events are only sent when the location is changing. I don't think we'll break any clients by sending an event even if the shape didn't change. If we really care to avoid this then I think we should add a new touch shape event to chrome and track this at the evdev level instead of here. > > We will have more fields here where we will apply the same pattern. Tilt and force as well. So at that time we would be at up to 4 events (shape, tilt, force, motion) for every update, so the overhead will be increasing. I suspect that this is still not going to add any significant overhead. We'll send a few more bytes across the channel but we're not talking much data here. Again, if we want to reduce processing overhead in regards to this then we should probably do that at a lower level. > > Either way, I think it would be fully functional with little overhead if we just send those events for every update. I am just following the practice we were using in the Pointer class. Keeping things simple for now is best I think and we can always micro optimize this later if it turns out to be a problem. > > AlmostEqual is really just a generic function to compare to floating point values for equality since you cannot compare them directly. So maybe FloatAlmostEqual would be more fitting? Why not simply "abs(a - b) < epsilon" ?
https://codereview.chromium.org/2560633002/diff/40001/components/exo/touch.cc File components/exo/touch.cc (right): https://codereview.chromium.org/2560633002/diff/40001/components/exo/touch.cc... components/exo/touch.cc:20: static bool AlmostEqual(T x, T y) { On 2016/12/07 22:58:00, reveman wrote: > On 2016/12/07 at 18:32:18, denniskempin wrote: > > On 2016/12/07 03:16:18, reveman wrote: > > > This would need some explaining and maybe a rename to TouchAxisAlmostEqual. > But > > > first, do we really need this? Sending a Touch::OnTouchShape event for every > > > touch event would be so much easier and it doesn't seem like that would add > any > > > significant overhead. Am I missing something here? > > > > We don't really have to do this, but the protocol asks for those events to be > only sent when the shape is changing, much like mouse events are only sent when > the location is changing. > > I don't think we'll break any clients by sending an event even if the shape > didn't change. If we really care to avoid this then I think we should add a new > touch shape event to chrome and track this at the evdev level instead of here. > > > > > We will have more fields here where we will apply the same pattern. Tilt and > force as well. So at that time we would be at up to 4 events (shape, tilt, > force, motion) for every update, so the overhead will be increasing. > > I suspect that this is still not going to add any significant overhead. We'll > send a few more bytes across the channel but we're not talking much data here. > Again, if we want to reduce processing overhead in regards to this then we > should probably do that at a lower level. > > > > > Either way, I think it would be fully functional with little overhead if we > just send those events for every update. I am just following the practice we > were using in the Pointer class. > > Keeping things simple for now is best I think and we can always micro optimize > this later if it turns out to be a problem. > > > > > AlmostEqual is really just a generic function to compare to floating point > values for equality since you cannot compare them directly. So maybe > FloatAlmostEqual would be more fitting? > > Why not simply "abs(a - b) < epsilon" ? sgtm. Let's go with always sending the update. It's significantly simpler. https://codereview.chromium.org/2560633002/diff/40001/components/exo/touch_de... File components/exo/touch_delegate.h (right): https://codereview.chromium.org/2560633002/diff/40001/components/exo/touch_de... components/exo/touch_delegate.h:47: // Called when a touch point has changed it's shape. On 2016/12/07 03:16:18, reveman wrote: > s/it's/its/ I keep using the ESL excuse, but after 4 years in the US that doesn't cut it anymore ;)
lgtm % nits https://codereview.chromium.org/2560633002/diff/60001/components/exo/touch.cc File components/exo/touch.cc (right): https://codereview.chromium.org/2560633002/diff/60001/components/exo/touch.cc... components/exo/touch.cc:125: delegate_->OnTouchShape(event->touch_id(), Can you move this up into the switch cases above instead so we only send it if the touch id is valid? That way we also avoid branching twice. https://codereview.chromium.org/2560633002/diff/60001/components/exo/touch.cc... components/exo/touch.cc:129: // todo(denniskempin): Extend ui::TouchEvent to signal end of sequence of s/todo/TODO/ https://codereview.chromium.org/2560633002/diff/60001/components/exo/touch.cc... components/exo/touch.cc:131: delegate_->OnTouchFrame(); Move this up into the switch cases as well to avoid sending if touch_id is not valid.
The CQ bit was checked by denniskempin@google.com
The patchset sent to the CQ was uploaded after l-g-t-m from sadrul@chromium.org, reveman@chromium.org Link to the patchset: https://codereview.chromium.org/2560633002/#ps80001 (title: "fixed nits")
The CQ bit was unchecked by commit-bot@chromium.org
This CL has an open dependency (Issue 2548603002 Patch 40001). Please resolve the dependency and try again. If you are sure that there is no real dependency, please use one of the options listed in https://goo.gl/9Es4OR to land the CL.
The CQ bit was checked by denniskempin@google.com
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: linux_chromium_compile_dbg_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by denniskempin@google.com
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: cast_shell_linux on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/cast_shell_linu...)
The CQ bit was checked by denniskempin@google.com
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: win_chromium_x64_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_...)
The CQ bit was checked by denniskempin@google.com
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: win_clang on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_clang/builds/...)
The CQ bit was checked by denniskempin@google.com
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: linux_chromium_chromeos_ozone_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by denniskempin@google.com
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: linux_chromium_chromeos_ozone_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by denniskempin@google.com
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: linux_chromium_chromeos_ozone_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by denniskempin@google.com
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: linux_chromium_chromeos_ozone_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
Jacob, FYI I changed event generator to allow for more generic pointer details.
The CQ bit was checked by denniskempin@google.com
The patchset sent to the CQ was uploaded after l-g-t-m from reveman@chromium.org, sadrul@chromium.org Link to the patchset: https://codereview.chromium.org/2560633002/#ps100001 (title: "Fixed pen pointer mode conflict after rebase")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch. Bot data: {"patchset_id": 100001, "attempt_start_ts": 1481829119368090, "parent_rev": "4ba958d22e008ef8298a8c90210bb81167d399b2", "commit_rev": "d845e80d6d9617825b43af8425ac9c9a6c20e5d8"}
Message was sent while issue was closed.
Description was changed from ========== exo: Implement v6 of touch protocol including shape and frame event This is a prerequisite for passing along pen information via touch events. Ideally we want to batch multiple touch updates of a single hardware event together with a single frame event. However this will need an extension of ui::TouchEvents. We still provide a valid implementation of wl_touch by sending a frame for every updated touch separately. BUG=665499 TEST=Updated unit tests ========== to ========== exo: Implement v6 of touch protocol including shape and frame event This is a prerequisite for passing along pen information via touch events. Ideally we want to batch multiple touch updates of a single hardware event together with a single frame event. However this will need an extension of ui::TouchEvents. We still provide a valid implementation of wl_touch by sending a frame for every updated touch separately. BUG=665499 TEST=Updated unit tests Review-Url: https://codereview.chromium.org/2560633002 ==========
Message was sent while issue was closed.
Committed patchset #6 (id:100001)
Message was sent while issue was closed.
Description was changed from ========== exo: Implement v6 of touch protocol including shape and frame event This is a prerequisite for passing along pen information via touch events. Ideally we want to batch multiple touch updates of a single hardware event together with a single frame event. However this will need an extension of ui::TouchEvents. We still provide a valid implementation of wl_touch by sending a frame for every updated touch separately. BUG=665499 TEST=Updated unit tests Review-Url: https://codereview.chromium.org/2560633002 ========== to ========== exo: Implement v6 of touch protocol including shape and frame event This is a prerequisite for passing along pen information via touch events. Ideally we want to batch multiple touch updates of a single hardware event together with a single frame event. However this will need an extension of ui::TouchEvents. We still provide a valid implementation of wl_touch by sending a frame for every updated touch separately. BUG=665499 TEST=Updated unit tests Committed: https://crrev.com/f4361e3208bca8ab2a5a8a2cc1af1b04602fdf2e Cr-Commit-Position: refs/heads/master@{#438908} ==========
Message was sent while issue was closed.
Patchset 6 (id:??) landed as https://crrev.com/f4361e3208bca8ab2a5a8a2cc1af1b04602fdf2e Cr-Commit-Position: refs/heads/master@{#438908} |