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

Issue 3017493002: Fix coordinate calculations under pinch-zoom

Created:
3 years, 3 months ago by bokan
Modified:
3 years, 2 months ago
Reviewers:
nednguyen, ericrk
CC:
catapult-reviews_chromium.org, telemetry-reviews_chromium.org
Target Ref:
refs/heads/master
Project:
catapult
Visibility:
Public.

Description

Fix coordinate calculations under pinch-zoom This CL fixes how telemetry calculates coordinates under pinch-zoom. This has been broken because pinch-zoom is more than just a multiplication by a scale, it also includes a translation to account for the visual viewport's offset within the root frame. Thus, to convert a coordinate in the root frame to a coordinate in the visual viewport (i.e. the user's screen), we use: (x, y) = ((x1, y1) - visualViewportOffset) * pageScaleFactor However, this change also requires that gpuBenchmarking's methods know that incoming coordinates are relative to the visual viewport. gpuBenchmarking today tries to apply page scale to most coordinates. There is a follow up patch that removes the pageScaleFactor application in gpuBenchmarking: https://crrev.com/c/668376 Hoewver, until gpuBenchmarking is changed, we don't want to change the coordinate system we use in Catapult but we can't change gpuBenchmarking until the Catapult repo changes are rolled into Chrome. This, I've gated the changes here on an attribute that the above patch will add to gpuBenchmarking. Once both changes land I can remove the attribute and the old code in this patch. In addition, the PinchAction supported pinching-in on a specific Element. This functionality is broken and unused so I've remoted it. The telemetry code always tries to zoom into the center of the viewport. I've also updated pageScaleFactor calculation to take account of the inert visualViewport changes which means that innerWidth / outerWidth no longer represents the scale factor.

Patch Set 1 #

Total comments: 5

Patch Set 2 : Add comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+54 lines, -85 lines) Patch
M telemetry/telemetry/internal/actions/action_runner.py View 2 chunks +1 line, -34 lines 0 comments Download
M telemetry/telemetry/internal/actions/gesture_common.js View 1 2 chunks +24 lines, -13 lines 0 comments Download
M telemetry/telemetry/internal/actions/pinch.js View 2 chunks +18 lines, -8 lines 0 comments Download
M telemetry/telemetry/internal/actions/pinch.py View 4 chunks +11 lines, -30 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 16 (11 generated)
bokan
Hi Ned, Not really sure who should review this - feel free to punt to ...
3 years, 3 months ago (2017-09-15 10:37:27 UTC) #7
nednguyen
I am not an expert to review the math here, Eric: can you review this ...
3 years, 3 months ago (2017-09-15 10:49:59 UTC) #9
ericrk
I think this looks good. A few small questions. https://codereview.chromium.org/3017493002/diff/1/telemetry/telemetry/internal/actions/action_runner.py File telemetry/telemetry/internal/actions/action_runner.py (left): https://codereview.chromium.org/3017493002/diff/1/telemetry/telemetry/internal/actions/action_runner.py#oldcode374 telemetry/telemetry/internal/actions/action_runner.py:374: ...
3 years, 3 months ago (2017-09-15 16:41:04 UTC) #10
bokan
https://codereview.chromium.org/3017493002/diff/1/telemetry/telemetry/internal/actions/gesture_common.js File telemetry/telemetry/internal/actions/gesture_common.js (right): https://codereview.chromium.org/3017493002/diff/1/telemetry/telemetry/internal/actions/gesture_common.js#newcode58 telemetry/telemetry/internal/actions/gesture_common.js:58: if ('gesturesExpectedInViewportCoordinates' in chrome.gpuBenchmarking) { On 2017/09/15 16:41:04, ericrk ...
3 years, 3 months ago (2017-09-17 05:48:51 UTC) #11
bokan
3 years, 2 months ago (2017-09-25 19:55:13 UTC) #16
Post-BlinkON ping :)

Powered by Google App Engine
This is Rietveld 408576698