viz: Wait for fullscreen damage after reallocating buffers
A page flip can result in a SWAP_NAK_RECREATE_BUFFERS signal, indicating that the backing buffers must be recreated. Since the buffers are entirely uninitialized, we should damage the entire screen for the next draw [1]. Unfortunately, this doesn't work in SkiaRenderer because the GPU thread performs the actual reallocation [2] and then posts a task to the Viz thread to update the damage. The task taces with the next invocation of DirectRenderer::DrawFrame, so there's no guarantee that the new damage will be picked up in time for the next frame. If it isn't, we will present a buffer with uninitialized data. This CL fixes this issue by pausing SwapBuffer invocations after reallocating buffers until we receive a frame with full screen damage (e.g. the Viz thread catches up with the GPU thread). [1] https://source.chromium.org/chromium/chromium/src/+/master:components/viz/service/display_embedder/gl_output_surface_buffer_queue.cc;l=263;drc=3c0194e7917daed5debe0d0772393e5784367e01 [2] https://source.chromium.org/chromium/chromium/src/+/master:components/viz/service/display_embedder/skia_output_device_buffer_queue.cc;l=458;drc=7ccffaf0933ccc647c744bf66971bcf5f33a676a Bug: 1156182 Change-Id: Ibf0bf3d6903c4c4f2dadcfc71dfda36a03b513d3 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2630227Reviewed-by:Vasiliy Telezhnikov <vasilyt@chromium.org> Commit-Queue: Brian Ho <hob@chromium.org> Cr-Commit-Position: refs/heads/master@{#844167}
Showing
Please register or sign in to comment