зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1117712 - Introduce AsyncPanZoomController::GetTransformToThis(). r=kats
This commit is contained in:
Родитель
a57c0aa1f1
Коммит
475eb0771c
|
@ -1757,22 +1757,21 @@ nsEventStatus AsyncPanZoomController::OnCancelTap(const TapGestureInput& aEvent)
|
|||
}
|
||||
|
||||
|
||||
Matrix4x4 AsyncPanZoomController::GetTransformToThis() const {
|
||||
if (APZCTreeManager* treeManagerLocal = GetApzcTreeManager()) {
|
||||
return treeManagerLocal->GetScreenToApzcTransform(this);
|
||||
}
|
||||
return Matrix4x4();
|
||||
}
|
||||
|
||||
ScreenPoint AsyncPanZoomController::ToScreenCoordinates(const ParentLayerPoint& aVector,
|
||||
const ParentLayerPoint& aAnchor) const {
|
||||
if (APZCTreeManager* treeManagerLocal = GetApzcTreeManager()) {
|
||||
Matrix4x4 apzcToScreen = treeManagerLocal->GetScreenToApzcTransform(this).Inverse();
|
||||
return TransformVector<ScreenPixel>(apzcToScreen, aVector, aAnchor);
|
||||
}
|
||||
return ViewAs<ScreenPixel>(aVector, PixelCastJustification::TransformNotAvailable);
|
||||
return TransformVector<ScreenPixel>(GetTransformToThis().Inverse(), aVector, aAnchor);
|
||||
}
|
||||
|
||||
ParentLayerPoint AsyncPanZoomController::ToParentLayerCoordinates(const ScreenPoint& aVector,
|
||||
const ScreenPoint& aAnchor) const {
|
||||
if (APZCTreeManager* treeManagerLocal = GetApzcTreeManager()) {
|
||||
Matrix4x4 transform = treeManagerLocal->GetScreenToApzcTransform(this);
|
||||
return TransformVector<ParentLayerPixel>(transform, aVector, aAnchor);
|
||||
}
|
||||
return ViewAs<ParentLayerPixel>(aVector, PixelCastJustification::TransformNotAvailable);
|
||||
return TransformVector<ParentLayerPixel>(GetTransformToThis(), aVector, aAnchor);
|
||||
}
|
||||
|
||||
ScreenCoord AsyncPanZoomController::PanDistance() const {
|
||||
|
|
|
@ -328,6 +328,14 @@ public:
|
|||
*/
|
||||
int32_t GetLastTouchIdentifier() const;
|
||||
|
||||
/**
|
||||
* Returns the matrix that transforms points from global screen space into
|
||||
* this APZC's ParentLayer space.
|
||||
* To respect the lock ordering, mMonitor must NOT be held when calling
|
||||
* this function (since this function acquires the tree lock).
|
||||
*/
|
||||
Matrix4x4 GetTransformToThis() const;
|
||||
|
||||
/**
|
||||
* Convert the vector |aVector|, rooted at the point |aAnchor|, from
|
||||
* this APZC's ParentLayer coordinates into screen coordinates.
|
||||
|
|
Загрузка…
Ссылка в новой задаче