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

Issue 2664013002: input: Restrict synthetic touch gesture to view bounds.

Created:
3 years, 10 months ago by sunnyps
Modified:
3 years, 10 months ago
Reviewers:
bokan
CC:
chromium-reviews, jam, darin-cc_chromium.org, dtapuska+chromiumwatch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

input: Restrict synthetic touch gesture to view bounds. BUG=686390

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+18 lines, -4 lines) Patch
M content/browser/renderer_host/input/synthetic_gesture_target.h View 2 chunks +3 lines, -0 lines 0 comments Download
M content/browser/renderer_host/input/synthetic_gesture_target_base.h View 1 chunk +2 lines, -0 lines 0 comments Download
M content/browser/renderer_host/input/synthetic_gesture_target_base.cc View 1 chunk +4 lines, -0 lines 0 comments Download
M content/browser/renderer_host/input/synthetic_touchscreen_pinch_gesture.cc View 3 chunks +9 lines, -4 lines 0 comments Download

Messages

Total messages: 5 (1 generated)
sunnyps
This fixes the crash that happens in the smoothness.tough_pinch_zoom_cases benchmark on android. WDYT of this ...
3 years, 10 months ago (2017-01-30 23:45:21 UTC) #2
bokan
On 2017/01/30 23:45:21, sunnyps wrote: > This fixes the crash that happens in the smoothness.tough_pinch_zoom_cases ...
3 years, 10 months ago (2017-02-01 04:43:54 UTC) #3
sunnyps
On 2017/02/01 04:43:54, bokan wrote: > On 2017/01/30 23:45:21, sunnyps wrote: > > This fixes ...
3 years, 10 months ago (2017-02-02 21:36:41 UTC) #4
sunnyps
3 years, 10 months ago (2017-02-02 22:36:00 UTC) #5
On 2017/02/02 21:36:41, sunnyps wrote:
> On 2017/02/01 04:43:54, bokan wrote:
> > On 2017/01/30 23:45:21, sunnyps wrote:
> > > This fixes the crash that happens in the smoothness.tough_pinch_zoom_cases
> > > benchmark on android. WDYT of this approach?
> > 
> > This means the size of the zoom will depend on the screen size and so
> introduce
> > variation between devices. I think a better approach would just be to make
the
> > pinch distance small enough so that the gesture touches never leave the
screen
> > on any devices (and DCHECK if they leave the viewport). i.e. If we want to
> zoom
> > in to 3X, rather than using 3 large pinches, use 6 pinch gestures of half
> size.
> 
> My "fix" doesn't work because it only clamps at one end.
> 
> The real problem is caused by mixing up CSS pixels and DIPs in telemetry and
> then trying to correct that in GpuBenchmarking::PinchBy/SmoothScrollBy/etc.
> 
> 1. GpuBenchmarking::VisualViewportWidth/Height is in CSS pixels.
> 2. gesture_common.js getWindowWidth/Height converts this into DIP by scaling
> with page scale factor.
> 3. gesture_common.js getBoundingRect returns the element's bounding rect
> relative to the root frame in CSS pixels.
> 4. gesture_common.js getBoundingVisibleRect clamps the bounding rect in CSS
> pixels to window width/height in DIP to get the anchor point.
> 5. GpuBenchmarking::PinchBy converts anchor point in CSS pixels to DIP by
> scaling with page scale factor.

I made a patch which converts to DIP inside telemetry (scale getBoundingRect by
page scale factor) and that seems to work fine. The anchor point is at the
middle of the screen which is expected. But I wonder if it's better to use CSS
pixels in telemetry and convert to DIP (and clamp) inside GpuBenchmarking. WDYT?

Powered by Google App Engine
This is Rietveld 408576698