Bug 1556556 - Rename GetCallbackTransform() to GetVisualToLayoutTransform(). r=kats

We will be applying and unapplying this transform in many places, and
thinking about those operations as "applying the callback transform" and
"unapplying the callback transform" is not very intuitive, especially since
applying the callback transform involves *un*applying the resolution.

Rather, going forward we will use the terminology "visual coordinates"
and "layout coordinates" and use this function to convert back and forth
between them.

ApplyCallbackTransform() is not renamed here because subsequent patches will
transition its callers to use GetVisualToLayoutTransform() and
ApplyCallbackTransform() will be removed.

Differential Revision: https://phabricator.services.mozilla.com/D68297
This commit is contained in:
Botond Ballo 2020-04-28 01:35:18 +00:00
Родитель 20522092c5
Коммит 3bb8b9c86c
2 изменённых файлов: 8 добавлений и 5 удалений

Просмотреть файл

@ -14,7 +14,7 @@ namespace mozilla {
using layers::APZCCallbackHelper;
using layers::ScrollableLayerGuid;
CSSToCSSMatrix4x4 ViewportUtils::GetCallbackTransform(
CSSToCSSMatrix4x4 ViewportUtils::GetVisualToLayoutTransform(
ScrollableLayerGuid::ViewID aScrollId) {
if (aScrollId == ScrollableLayerGuid::NULL_SCROLL_ID) {
return {};

Просмотреть файл

@ -12,9 +12,12 @@ namespace mozilla {
class ViewportUtils {
public:
/* Return a "callback transform" to be applied to the coordinates of input
events targeting content inside the scroll frame identified by |aScrollId|.
The callback transform has two components:
/* Return a transform to be applied to the coordinates of input events
targeting content inside the scroll frame identified by |aScrollId|, which
converts from "visual coordinates" (which are the coordinates events have
when they arrive from APZ) to "layout coordinates" (which are the
coordinates used in most places by layout code). The transform has two
components:
1. The pres shell resolution, representing the pinch-zoom scale
(if the scroll frame |aScrollId| is inside the resolution, which
is most of the time).
@ -27,7 +30,7 @@ class ViewportUtils {
up to the root, using values populated in
APZCCallbackHelper::UpdateCallbackTransform. See that method's
documentation for additional details. */
static CSSToCSSMatrix4x4 GetCallbackTransform(
static CSSToCSSMatrix4x4 GetVisualToLayoutTransform(
layers::ScrollableLayerGuid::ViewID aScrollId);
};