mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1043859 - Expose the APZC overscroll transform as a separate function. r=botond
This commit is contained in:
parent
f6dd5109c3
commit
c0ef7b508e
@ -2453,7 +2453,11 @@ bool AsyncPanZoomController::UpdateAnimation(const TimeStamp& aSampleTime,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AsyncPanZoomController::GetOverscrollTransform(Matrix4x4* aTransform) const {
|
Matrix4x4 AsyncPanZoomController::GetOverscrollTransform() const {
|
||||||
|
if (!IsOverscrolled()) {
|
||||||
|
return Matrix4x4();
|
||||||
|
}
|
||||||
|
|
||||||
// The overscroll effect is a uniform stretch along the overscrolled axis,
|
// The overscroll effect is a uniform stretch along the overscrolled axis,
|
||||||
// with the edge of the content where we have reached the end of the
|
// with the edge of the content where we have reached the end of the
|
||||||
// scrollable area pinned into place.
|
// scrollable area pinned into place.
|
||||||
@ -2488,8 +2492,8 @@ void AsyncPanZoomController::GetOverscrollTransform(Matrix4x4* aTransform) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Combine the transformations into a matrix.
|
// Combine the transformations into a matrix.
|
||||||
*aTransform = Matrix4x4().Scale(scaleX, scaleY, 1)
|
return Matrix4x4().Scale(scaleX, scaleY, 1)
|
||||||
.PostTranslate(translation.x, translation.y, 0);
|
.PostTranslate(translation.x, translation.y, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AsyncPanZoomController::AdvanceAnimations(const TimeStamp& aSampleTime)
|
bool AsyncPanZoomController::AdvanceAnimations(const TimeStamp& aSampleTime)
|
||||||
@ -2565,19 +2569,12 @@ bool AsyncPanZoomController::AdvanceAnimations(const TimeStamp& aSampleTime)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void AsyncPanZoomController::SampleContentTransformForFrame(ViewTransform* aOutTransform,
|
void AsyncPanZoomController::SampleContentTransformForFrame(ViewTransform* aOutTransform,
|
||||||
ScreenPoint& aScrollOffset,
|
ScreenPoint& aScrollOffset)
|
||||||
Matrix4x4* aOutOverscrollTransform)
|
|
||||||
{
|
{
|
||||||
ReentrantMonitorAutoEnter lock(mMonitor);
|
ReentrantMonitorAutoEnter lock(mMonitor);
|
||||||
|
|
||||||
aScrollOffset = mFrameMetrics.GetScrollOffset() * mFrameMetrics.GetZoom();
|
aScrollOffset = mFrameMetrics.GetScrollOffset() * mFrameMetrics.GetZoom();
|
||||||
*aOutTransform = GetCurrentAsyncTransform();
|
*aOutTransform = GetCurrentAsyncTransform();
|
||||||
|
|
||||||
// If we are overscrolled, we would like the compositor to apply an
|
|
||||||
// additional transform that produces an overscroll effect.
|
|
||||||
if (aOutOverscrollTransform && IsOverscrolled()) {
|
|
||||||
GetOverscrollTransform(aOutOverscrollTransform);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ViewTransform AsyncPanZoomController::GetCurrentAsyncTransform() const {
|
ViewTransform AsyncPanZoomController::GetCurrentAsyncTransform() const {
|
||||||
|
@ -166,18 +166,17 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Query the transforms that should be applied to the layer corresponding
|
* Query the transforms that should be applied to the layer corresponding
|
||||||
* to this APZC due to asynchronous panning and zooming.
|
* to this APZC due to asynchronous panning and zooming.
|
||||||
* This function returns two transforms via out parameters:
|
* This function returns the async transform via the |aOutTransform|
|
||||||
* |aOutTransform| is the transform due to regular panning and zooming
|
* out parameter.
|
||||||
* |aOverscrollTransform| is the transform due to overscrolling
|
|
||||||
* The two are separated because some clients want to ignore the overscroll
|
|
||||||
* transform for some purposes (and for convenience to these clients, the
|
|
||||||
* overscroll transform parameter may be nullptr). Clients who do not want
|
|
||||||
* to ignore the overscroll transform should multiply the two transforms
|
|
||||||
* together.
|
|
||||||
*/
|
*/
|
||||||
void SampleContentTransformForFrame(ViewTransform* aOutTransform,
|
void SampleContentTransformForFrame(ViewTransform* aOutTransform,
|
||||||
ScreenPoint& aScrollOffset,
|
ScreenPoint& aScrollOffset);
|
||||||
Matrix4x4* aOutOverscrollTransform);
|
|
||||||
|
/**
|
||||||
|
* Return a visual effect that reflects this apzc's
|
||||||
|
* overscrolled state, if any.
|
||||||
|
*/
|
||||||
|
Matrix4x4 GetOverscrollTransform() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A shadow layer update has arrived. |aLayerMetrics| is the new FrameMetrics
|
* A shadow layer update has arrived. |aLayerMetrics| is the new FrameMetrics
|
||||||
@ -595,12 +594,6 @@ private:
|
|||||||
*/
|
*/
|
||||||
bool ConvertToGecko(const ScreenPoint& aPoint, CSSPoint* aOut);
|
bool ConvertToGecko(const ScreenPoint& aPoint, CSSPoint* aOut);
|
||||||
|
|
||||||
/**
|
|
||||||
* Return in |aTransform| a visual effect that reflects this apzc's
|
|
||||||
* overscrolled state, if any.
|
|
||||||
*/
|
|
||||||
void GetOverscrollTransform(Matrix4x4* aTransform) const;
|
|
||||||
|
|
||||||
enum AxisLockMode {
|
enum AxisLockMode {
|
||||||
FREE, /* No locking at all */
|
FREE, /* No locking at all */
|
||||||
STANDARD, /* Default axis locking mode that remains locked until pan ends*/
|
STANDARD, /* Default axis locking mode that remains locked until pan ends*/
|
||||||
|
@ -586,11 +586,10 @@ AsyncCompositionManager::ApplyAsyncContentTransformToTree(Layer *aLayer)
|
|||||||
hasAsyncTransform = true;
|
hasAsyncTransform = true;
|
||||||
|
|
||||||
ViewTransform asyncTransformWithoutOverscroll;
|
ViewTransform asyncTransformWithoutOverscroll;
|
||||||
Matrix4x4 overscrollTransform;
|
|
||||||
ScreenPoint scrollOffset;
|
ScreenPoint scrollOffset;
|
||||||
controller->SampleContentTransformForFrame(&asyncTransformWithoutOverscroll,
|
controller->SampleContentTransformForFrame(&asyncTransformWithoutOverscroll,
|
||||||
scrollOffset,
|
scrollOffset);
|
||||||
&overscrollTransform);
|
Matrix4x4 overscrollTransform = controller->GetOverscrollTransform();
|
||||||
|
|
||||||
if (!aLayer->IsScrollInfoLayer()) {
|
if (!aLayer->IsScrollInfoLayer()) {
|
||||||
controller->MarkAsyncTransformAppliedToContent();
|
controller->MarkAsyncTransformAppliedToContent();
|
||||||
|
@ -162,10 +162,9 @@ public:
|
|||||||
bool SampleContentTransformForFrame(const TimeStamp& aSampleTime,
|
bool SampleContentTransformForFrame(const TimeStamp& aSampleTime,
|
||||||
ViewTransform* aOutTransform,
|
ViewTransform* aOutTransform,
|
||||||
ScreenPoint& aScrollOffset) {
|
ScreenPoint& aScrollOffset) {
|
||||||
Matrix4x4 aOverscrollTransform; // ignored
|
|
||||||
bool ret = AdvanceAnimations(aSampleTime);
|
bool ret = AdvanceAnimations(aSampleTime);
|
||||||
AsyncPanZoomController::SampleContentTransformForFrame(
|
AsyncPanZoomController::SampleContentTransformForFrame(
|
||||||
aOutTransform, aScrollOffset, &aOverscrollTransform);
|
aOutTransform, aScrollOffset);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user