DescriptionFix 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 #
Depends on Patchset: Messages
Total messages: 16 (11 generated)
|