Closed Bug 1596791 Opened 4 years ago Closed 4 years ago

Canvas updates during empty webrender transactions lead to textures being held for too long.

Categories

(Core :: Graphics, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla72
Tracking Status
firefox72 --- fixed

People

(Reporter: bobowen, Assigned: bobowen)

References

Details

Attachments

(1 file)

During empty transactions, WebRenderCanvasRendererAsync unconditionally sends OpUpdatedAsyncImagePipeline commands at [1].
These result in the TextureHost in the parent being held, but because the webrender is empty a render doesn't occur and the texture cannot be released until it does.

If several of these occur in a row then we quickly hit the maximum number of textures allowed in PersistentBufferProviderShared resulting in failure at [2].

The place where we have seen this occur most is in displaying PDFs via PDF.js.

[1] https://searchfox.org/mozilla-central/rev/cac340f10816707e91c46db6d285f80259420f07/gfx/layers/wr/WebRenderCanvasRenderer.cpp#93
[2] https://searchfox.org/mozilla-central/rev/cac340f10816707e91c46db6d285f80259420f07/gfx/layers/PersistentBufferProvider.cpp#324

If I invalidate the frame during the processing of OpUpdatedAsyncImagePipeline commands in the GPU process, this causes a frame to be rendered, which is presumably what we want and means the texture can be released.

In order to not invalidate all frames, I've also changed the code in WebRenderCanvasRendererAsync to only send the OpUpdatedAsyncImagePipeline command when a new texture has been sent.
Patch coming soon.

This stops the potential build up of held textures during a series of empty
webrender transactions, because of a render not happening. The patch also only
sends the OpUpdatedAsyncImagePipeline command when a new texture has been
forwarded for the canvas, to prevent unnecessary invalidation.

Pushed by bobowencode@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/68c4c2622a23
Invalidate the rendered frame when processing OpUpdatedAsyncImagePipeline commands. r=nical
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla72
You need to log in before you can comment on or make changes to this bug.