Closed Bug 978248 Opened 10 years ago Closed 10 years ago

Displayport not tile-aligned on first paint

Categories

(Core :: Panning and Zooming, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla30
blocking-b2g 1.4+
Tracking Status
firefox28 --- wontfix
firefox29 --- wontfix
firefox30 --- fixed
b2g-v1.4 --- fixed

People

(Reporter: botond, Assigned: botond)

References

Details

Attachments

(2 files)

I'm filing this based on Vlad's description on IRC; haven't tested it myself.

On a first paint, the displayport is not tile-aligned because MaybeAlignAndClampDisplayPort does not get called.

I'm pretty sure I can see why this is by inspection:

 - ScrollFrameHelper::mOriginOfLastScroll is initialized to nsGkAtoms::other [1].
   Nothing changes this by the time TabChild's before-first-paint handler
   calls APZCCallbackHelper::UpdateRootFrame().
 - ScrollFrameTo() does not set aSuccessOut to true if the origin of the 
   last scroll is set and not nsGkAtoms::apz [2].
 - APZCCallbackHelper::UpdateRootFrame() does not call 
   MaybeAlignAndClampDisplayPort() if ScrollFrameTo() did not set
   aSuccessOut.

[1] http://mxr.mozilla.org/mozilla-central/source/layout/generic/nsGfxScrollFrame.cpp#1554
[2] http://mxr.mozilla.org/mozilla-central/source/widget/xpwidgets/APZCCallbackHelper.cpp#111
[3] http://mxr.mozilla.org/mozilla-central/source/widget/xpwidgets/APZCCallbackHelper.cpp#111
This patch should resolve the problem by calling MaybeAlignAndClampDisplayPort() even if we called RecenterDisplayPort().

Someone who has tiling enabled should test this.
Attachment #8383909 - Flags: feedback?(bugmail.mozilla)
Comment on attachment 8383909 [details] [diff] [review]
Make sure display port is tile-aligned on first paint

ScrollFrameTo actually have three different possibilities:
1) no scroll frame, we can't ask it to scroll, we can't get it's scroll position, we turn (0,0)
2) we can't ask the scroll frame to scroll, but we return it's current scroll position
3) we scroll the scroll frame and return the resulting scroll position

I think this patch will make us handle 1) incorrectly. We will re-center the display port, and then call MaybeAlignAndClampDisplayPort with actualScrollOffset=(0,0), effectively moving the displayport by mScrollOffset on the frame metrics. I think this is the exact situation bug 966507, so it will unfix that bug. In this case perhaps we should call MaybeAlignAndClampDisplayPort with the mScrollOffset from the frame metrics.
If the scroll frame is just being recreated (so it will come back right away) it will most likely try to restore to the scroll position it had before it was recreated. This scroll position is much more likely to be closer to what the AZPC controller thinks is the scroll position then (0,0). This should fix the issue I described in the last comment.
Attachment #8384243 - Flags: review?(botond)
Blocks: b2g-tiling
Requesting 1.4? due to blocking bug 963073.
blocking-b2g: --- → 1.4?
Attachment #8384243 - Flags: review?(botond) → review+
Comment on attachment 8383909 [details] [diff] [review]
Make sure display port is tile-aligned on first paint

Vlad told me that this patch fixed the problem he was having. Flagging for review.
Attachment #8383909 - Flags: feedback?(bugmail.mozilla) → review?(tnikkel)
Attachment #8383909 - Flags: review?(tnikkel) → review+
landed my part
https://hg.mozilla.org/integration/b2g-inbound/rev/89282d84d99d
Whiteboard: [leave open]
Try push for the two patches together: https://tbpl.mozilla.org/?tree=Try&rev=e87813a56824
(In reply to Botond Ballo [:botond] from comment #7)
> Try push for the two patches together:
> https://tbpl.mozilla.org/?tree=Try&rev=e87813a56824

Looks clean. Landed: https://hg.mozilla.org/integration/b2g-inbound/rev/3601c5bc51e1
Whiteboard: [leave open]
This doesn't need to be 1.4+ in order to land, nor do we need to uplift it anywhere. Do you still want it blocking?
(In reply to Milan Sreckovic [:milan] from comment #10)
> This doesn't need to be 1.4+ in order to land, nor do we need to uplift it
> anywhere. Do you still want it blocking?

Guess not, then? I just assumed that, as with 1.3, something blocking a 1.4 blocker needs to also be a 1.4 blocker.
blocking-b2g: 1.4? → ---
No, I meant "if you're only asking for this to be a blocker because you want to land it, you don't need to". If this is required for tiling to be successful, we'll mark it a blocker. 
Can't tell if it should be :tn or :botond, as assignee, please reassign if I'm off.
Assignee: nobody → tnikkel
blocking-b2g: --- → 1.4+
https://hg.mozilla.org/mozilla-central/rev/3601c5bc51e1
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla30
Botond's is the main fix.
Assignee: tnikkel → botond
(In reply to Timothy Nikkel (:tn) from comment #2)
> ScrollFrameTo actually have three different possibilities:
> 1) no scroll frame, we can't ask it to scroll, we can't get it's scroll
> position, we turn (0,0)
> 2) we can't ask the scroll frame to scroll, but we return it's current
> scroll position
> 3) we scroll the scroll frame and return the resulting scroll position
> 
> I think this patch will make us handle 1) incorrectly. We will re-center the
> display port, and then call MaybeAlignAndClampDisplayPort with
> actualScrollOffset=(0,0), effectively moving the displayport by
> mScrollOffset on the frame metrics. I think this is the exact situation bug
> 966507, so it will unfix that bug. In this case perhaps we should call
> MaybeAlignAndClampDisplayPort with the mScrollOffset from the frame metrics.

This patch also made (2) be handled incorrectly. See https://bugzilla.mozilla.org/show_bug.cgi?id=1010119#c8
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: