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:
Kartikaya Gupta 2016-04-01 08:02:25 -04:00
Родитель 352f3c7654
Коммит 4cf9495b2a
3 изменённых файлов: 9 добавлений и 2 удалений

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

@ -2834,8 +2834,8 @@ const ScreenMargin AsyncPanZoomController::CalculatePendingDisplayPort(
displayPort.MoveBy((compositionSize.width - displayPort.width)/2.0f,
(compositionSize.height - displayPort.height)/2.0f);
// Make sure the displayport remains within the scrollable rect.
displayPort = displayPort.MoveInsideAndClamp(scrollableRect) - scrollOffset;
// Make the displayport relative to the scroll offset
displayPort = displayPort - scrollOffset;
APZC_LOG_FM(aFrameMetrics,
"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.
TEST_F(APZHitTestingTester, HitTesting2) {
SCOPED_GFX_PREF(APZVelocityBias, float, 0.0); // Velocity bias can cause extra repaint requests
CreateHitTesting2LayerTree();
ScopedLayerTreeRegistration registration(manager, 0, root, mcc);

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

@ -80,6 +80,7 @@ protected:
TEST_F(APZCPanningTester, Pan) {
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);
}
@ -93,22 +94,26 @@ TEST_F(APZCPanningTester, Pan) {
// events.
TEST_F(APZCPanningTester, PanWithTouchActionAuto) {
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
| mozilla::layers::AllowedTouchBehavior::VERTICAL_PAN);
}
TEST_F(APZCPanningTester, PanWithTouchActionNone) {
SCOPED_GFX_PREF(TouchActionEnabled, bool, true);
SCOPED_GFX_PREF(APZVelocityBias, float, 0.0); // Velocity bias can cause extra repaint requests
DoPanTest(false, false, 0);
}
TEST_F(APZCPanningTester, PanWithTouchActionPanX) {
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);
}
TEST_F(APZCPanningTester, PanWithTouchActionPanY) {
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);
}