зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1251638 - Don't clamp the displayport to the scrollable rect on the compositor side. r=botond
The clamping already happens on the content side, in nsLayoutUtils::GetDisplayPort and friends. The clamping there is more accurate as it reflects the latest main- thread information about the size of the page and position of the displayport base rect, which the compositor thread does not have. Since we are not clamping the displayport on the compositor side, it can "slosh around" a bit more and ends up sending a few more repaint requests when scrolling near the edges of the scrollable frame. This causes some gtests to fail because of the "extra" repaint requests. Disabling the velocity bias removes the sloshing around and fixes the test failures. MozReview-Commit-ID: JgBDi0M3Wtt
This commit is contained in:
Родитель
352f3c7654
Коммит
4cf9495b2a
|
@ -2834,8 +2834,8 @@ const ScreenMargin AsyncPanZoomController::CalculatePendingDisplayPort(
|
||||||
displayPort.MoveBy((compositionSize.width - displayPort.width)/2.0f,
|
displayPort.MoveBy((compositionSize.width - displayPort.width)/2.0f,
|
||||||
(compositionSize.height - displayPort.height)/2.0f);
|
(compositionSize.height - displayPort.height)/2.0f);
|
||||||
|
|
||||||
// Make sure the displayport remains within the scrollable rect.
|
// Make the displayport relative to the scroll offset
|
||||||
displayPort = displayPort.MoveInsideAndClamp(scrollableRect) - scrollOffset;
|
displayPort = displayPort - scrollOffset;
|
||||||
|
|
||||||
APZC_LOG_FM(aFrameMetrics,
|
APZC_LOG_FM(aFrameMetrics,
|
||||||
"Calculated displayport as (%f %f %f %f) from velocity %s paint time %f metrics",
|
"Calculated displayport as (%f %f %f %f) from velocity %s paint time %f metrics",
|
||||||
|
|
|
@ -162,6 +162,8 @@ TEST_F(APZHitTestingTester, HitTesting1) {
|
||||||
|
|
||||||
// A more involved hit testing test that involves css and async transforms.
|
// A more involved hit testing test that involves css and async transforms.
|
||||||
TEST_F(APZHitTestingTester, HitTesting2) {
|
TEST_F(APZHitTestingTester, HitTesting2) {
|
||||||
|
SCOPED_GFX_PREF(APZVelocityBias, float, 0.0); // Velocity bias can cause extra repaint requests
|
||||||
|
|
||||||
CreateHitTesting2LayerTree();
|
CreateHitTesting2LayerTree();
|
||||||
ScopedLayerTreeRegistration registration(manager, 0, root, mcc);
|
ScopedLayerTreeRegistration registration(manager, 0, root, mcc);
|
||||||
|
|
||||||
|
|
|
@ -80,6 +80,7 @@ protected:
|
||||||
|
|
||||||
TEST_F(APZCPanningTester, Pan) {
|
TEST_F(APZCPanningTester, Pan) {
|
||||||
SCOPED_GFX_PREF(TouchActionEnabled, bool, false);
|
SCOPED_GFX_PREF(TouchActionEnabled, bool, false);
|
||||||
|
SCOPED_GFX_PREF(APZVelocityBias, float, 0.0); // Velocity bias can cause extra repaint requests
|
||||||
DoPanTest(true, true, mozilla::layers::AllowedTouchBehavior::NONE);
|
DoPanTest(true, true, mozilla::layers::AllowedTouchBehavior::NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,22 +94,26 @@ TEST_F(APZCPanningTester, Pan) {
|
||||||
// events.
|
// events.
|
||||||
TEST_F(APZCPanningTester, PanWithTouchActionAuto) {
|
TEST_F(APZCPanningTester, PanWithTouchActionAuto) {
|
||||||
SCOPED_GFX_PREF(TouchActionEnabled, bool, true);
|
SCOPED_GFX_PREF(TouchActionEnabled, bool, true);
|
||||||
|
SCOPED_GFX_PREF(APZVelocityBias, float, 0.0); // Velocity bias can cause extra repaint requests
|
||||||
DoPanTest(true, true, mozilla::layers::AllowedTouchBehavior::HORIZONTAL_PAN
|
DoPanTest(true, true, mozilla::layers::AllowedTouchBehavior::HORIZONTAL_PAN
|
||||||
| mozilla::layers::AllowedTouchBehavior::VERTICAL_PAN);
|
| mozilla::layers::AllowedTouchBehavior::VERTICAL_PAN);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(APZCPanningTester, PanWithTouchActionNone) {
|
TEST_F(APZCPanningTester, PanWithTouchActionNone) {
|
||||||
SCOPED_GFX_PREF(TouchActionEnabled, bool, true);
|
SCOPED_GFX_PREF(TouchActionEnabled, bool, true);
|
||||||
|
SCOPED_GFX_PREF(APZVelocityBias, float, 0.0); // Velocity bias can cause extra repaint requests
|
||||||
DoPanTest(false, false, 0);
|
DoPanTest(false, false, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(APZCPanningTester, PanWithTouchActionPanX) {
|
TEST_F(APZCPanningTester, PanWithTouchActionPanX) {
|
||||||
SCOPED_GFX_PREF(TouchActionEnabled, bool, true);
|
SCOPED_GFX_PREF(TouchActionEnabled, bool, true);
|
||||||
|
SCOPED_GFX_PREF(APZVelocityBias, float, 0.0); // Velocity bias can cause extra repaint requests
|
||||||
DoPanTest(false, true, mozilla::layers::AllowedTouchBehavior::HORIZONTAL_PAN);
|
DoPanTest(false, true, mozilla::layers::AllowedTouchBehavior::HORIZONTAL_PAN);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(APZCPanningTester, PanWithTouchActionPanY) {
|
TEST_F(APZCPanningTester, PanWithTouchActionPanY) {
|
||||||
SCOPED_GFX_PREF(TouchActionEnabled, bool, true);
|
SCOPED_GFX_PREF(TouchActionEnabled, bool, true);
|
||||||
|
SCOPED_GFX_PREF(APZVelocityBias, float, 0.0); // Velocity bias can cause extra repaint requests
|
||||||
DoPanTest(true, true, mozilla::layers::AllowedTouchBehavior::VERTICAL_PAN);
|
DoPanTest(true, true, mozilla::layers::AllowedTouchBehavior::VERTICAL_PAN);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче