Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(299)

Issue 1456063003: ozone: evdev: Fix tilt calculation for tablets (Closed)

Created:
5 years, 1 month ago by spang
Modified:
5 years, 1 month ago
Reviewers:
mustaq, Rick Byers
CC:
chromium-reviews, kalyank, tdresser+watch_chromium.org, ozone-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

ozone: evdev: Fix tilt calculation for tablets This makes tilt get populated per the Pointer Events spec with a Wacom Intuos Pro M Pen. BUG=557952 TEST=Wacom Intuos Pro M Pen on Chromebook Pixel with --enable-blink-features=PointerEvent & http://rbyers.github.io/eventTest.html Committed: https://crrev.com/b11a3a6c6f3a69a9bd39a79a9fe372d461ff76fc Cr-Commit-Position: refs/heads/master@{#360587}

Patch Set 1 #

Patch Set 2 : unit test #

Patch Set 3 : fix some parens #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+22 lines, -9 lines) Patch
M ui/events/ozone/evdev/tablet_event_converter_evdev.h View 1 chunk +5 lines, -2 lines 0 comments Download
M ui/events/ozone/evdev/tablet_event_converter_evdev.cc View 1 2 3 chunks +15 lines, -5 lines 1 comment Download
M ui/events/ozone/evdev/tablet_event_converter_evdev_unittest.cc View 1 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 9 (2 generated)
spang
Feel free to commit after reviewing
5 years, 1 month ago (2015-11-18 23:22:10 UTC) #2
mustaq
On 2015/11/18 23:22:10, spang wrote: > Feel free to commit after reviewing LGTM.
5 years, 1 month ago (2015-11-19 15:17:18 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1456063003/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1456063003/40001
5 years, 1 month ago (2015-11-19 15:18:36 UTC) #5
mustaq
https://codereview.chromium.org/1456063003/diff/40001/ui/events/ozone/evdev/tablet_event_converter_evdev.cc File ui/events/ozone/evdev/tablet_event_converter_evdev.cc (right): https://codereview.chromium.org/1456063003/diff/40001/ui/events/ozone/evdev/tablet_event_converter_evdev.cc#newcode48 ui/events/ozone/evdev/tablet_event_converter_evdev.cc:48: tilt_x_range_ = info.GetAbsMaximum(ABS_TILT_X) - tilt_x_min_ + 1; Have a ...
5 years, 1 month ago (2015-11-19 15:26:35 UTC) #6
commit-bot: I haz the power
Committed patchset #3 (id:40001)
5 years, 1 month ago (2015-11-19 15:45:37 UTC) #7
commit-bot: I haz the power
Patchset 3 (id:??) landed as https://crrev.com/b11a3a6c6f3a69a9bd39a79a9fe372d461ff76fc Cr-Commit-Position: refs/heads/master@{#360587}
5 years, 1 month ago (2015-11-19 15:46:36 UTC) #8
spang
5 years, 1 month ago (2015-11-19 16:13:31 UTC) #9
Message was sent while issue was closed.
On 2015/11/19 15:26:35, mustaq wrote:
>
https://codereview.chromium.org/1456063003/diff/40001/ui/events/ozone/evdev/t...
> File ui/events/ozone/evdev/tablet_event_converter_evdev.cc (right):
> 
>
https://codereview.chromium.org/1456063003/diff/40001/ui/events/ozone/evdev/t...
> ui/events/ozone/evdev/tablet_event_converter_evdev.cc:48: tilt_x_range_ =
> info.GetAbsMaximum(ABS_TILT_X) - tilt_x_min_ + 1;
> Have a quick question, didn't see it until CQing, sorry.
> 
> Does GetAbsMaximum() return the max possible raw "value" from device, or one
off
> from that? Because, intuitively, range = max-min, and thus the angle is +90
when
> the "value" == max:
>   180 * (max-min)/(max-min) - 90

We're not working with real numbers, this is an integer representation.

If we have K different integer values, then we've partitioned the 180 deg
interval into K equal subintervals each 180 deg / K degrees wide.

So we have to multiply by 180 / K in order to make our units degrees.

Here K = (max - min + 1) since the range is inclusive.

You're right that you can't get exactly +90deg out of this math, but we don't
need to. We haven't promised we can exactly represent any particular value, and
that's not actually possible starting from integers.

Powered by Google App Engine
This is Rietveld 408576698