Closed Bug 1431028 Opened 6 years ago Closed 6 years ago

Don't discard the back buffer in ClientSingleTiledLayerBuffer

Categories

(Core :: Graphics: Layers, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla59
Tracking Status
firefox59 --- fixed

People

(Reporter: jerry, Assigned: jerry)

References

Details

Attachments

(2 files)

When we play the full-screen video from https://www.csfd.cz/film/402192-zmensovani/videa/ , the video's progress bar will change the width every frame.

Gecko uses single tiled layer for the progress bar. If the buffer doesn't have an intermediate buffer, it will be discarded at the end of painting[1].
Then, gecko needs to allocate a new buffer again at the next frame.

Here is the profile data to show the heavy task at content side.
https://goo.gl/V6Ha6x

And this profile skip the buffer discarding.
https://perfht.ml/2Dkisjy

[1]
https://dxr.mozilla.org/mozilla-central/rev/e4107773cffb1baefd5446666fce22c4d6eb0517/gfx/layers/client/SingleTiledContentClient.cpp#339
Blocks: 1383292
We should only show the warning message when we have the on-white buffer.

MozReview-Commit-ID: 4gzo0reYIVL
Attachment #8943179 - Flags: review?(matt.woodrow)
Comment on attachment 8943180 [details] [diff] [review]
don't discard the back buffer in ClientSingleTiledLayerBuffer.

I don't know why we need to discard the back buffer. If we have the changes in next frame, we will need to allocate the buffer again. In comment 0, there is a case that will change the single tile layer's content. The profile data shows that it spends a lot of time for buffer allocation and repainting. If we skip the discarding for "non-intermediate" buffer, the profile looks better. This change might increase the memory usage.
Attachment #8943180 - Flags: review?(matt.woodrow)
Attachment #8943179 - Flags: review?(matt.woodrow) → review+
Attachment #8943180 - Flags: review?(matt.woodrow) → review+
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/8a8805912145
Don't discard the back buffer in ClientSingleTiledLayerBuffer. r=mattwoodrow
https://hg.mozilla.org/integration/mozilla-inbound/rev/80b5219aedd8
Move the gfx warning to the correct position. r=mattwoodrow
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/8a8805912145
https://hg.mozilla.org/mozilla-central/rev/80b5219aedd8
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla59
You need to log in before you can comment on or make changes to this bug.