Closed Bug 1238805 Opened 8 years ago Closed 8 years ago

We're still repainting more often than the displayport changes during APZ scrolling

Categories

(Core :: Panning and Zooming, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1192910
Tracking Status
firefox46 --- affected

People

(Reporter: botond, Unassigned)

References

Details

STR:
  1. Run Nightly on Linux
  2. Load the test page from bug 1238571
     (https://bug1238571.bmoattachments.org/attachment.cgi?id=8706396)
  3. Scroll around with the mouse wheel

Expected results:
  As per bug 1187432, we only repaint when the displayport changes

Actual results:
  We repaint on almost every composite
When calculating the position of the displayport relative to the scroll port, we factor in the current velocity [1]. While the displayport remains the same size, this results in the distribution of that size between the top and bottom margins to shift slightly from composite to composite. As a result, we fail to return early from SetDisplayPortMargins() here [2], and schedule a paint.

[1] https://dxr.mozilla.org/mozilla-central/rev/5acc2a44834ce0614f98466475e674517daf0041/gfx/layers/apz/src/AsyncPanZoomController.cpp#2722
[2] https://dxr.mozilla.org/mozilla-central/rev/5acc2a44834ce0614f98466475e674517daf0041/layout/base/nsLayoutUtils.cpp#1154
(In reply to Botond Ballo [:botond] from comment #1)
> When calculating the position of the displayport relative to the scroll
> port, we factor in the current velocity [1]. While the displayport remains
> the same size, this results in the distribution of that size between the top
> and bottom margins to shift slightly from composite to composite.

Actually, this is not the only source of small shifts in the display port margins. Even with apz.velocity_bias set to 0, which prevents the shift described above, SetDisplayPortMargins() is seeing small variations.
The other source of small shifts in the display port margins is AdjustDisplayPortForScrollDelta() [1], which takes the small (fractional) difference between the scroll offset we tried to set on Gecko, and the one it actually accepted, and adjusts the display port margins by that value.

[1] https://dxr.mozilla.org/mozilla-central/rev/5acc2a44834ce0614f98466475e674517daf0041/gfx/layers/apz/util/APZCCallbackHelper.cpp#143
With the above two issues worked around, we are no longer painting on every composite, as expected.

If these two issues aren't occurring on OS X (as suggested by Markus' observations in bug 1238571), I'd be curious to know why.
Interesting diagnosis!

(In reply to Botond Ballo [:botond] from comment #4)
> If these two issues aren't occurring on OS X (as suggested by Markus'
> observations in bug 1238571), I'd be curious to know why.

I have apz.velocity_bias set to zero in my profile, and I'm scrolling with the touchpad, which sends scroll deltas in integer pixel increments.

The patch in bug 1192910 will fix this bug as well, I think.
(In reply to Markus Stange [:mstange] from comment #5)
> The patch in bug 1192910 will fix this bug as well, I think.

Confirmed that this is the case. Closing as dupe.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.