[ozone/wayland]: Allow to create wl_buffers for null widgets.
The SkiaRenderer uses an image factory that creates anonymous images and native pixmaps. That means a GbmPixmapWayland does not receive an AcceleratedWidget that it will be attached to until a buffer commit request comes. With the implementation we have at the moment, that results in GbmPixmapWayland being a staging buffer without its counterpart created on the browser process side. However, when the SkiaRenderer feature is enabled, we want to create a GbmPixmapWayland with a null widget passed and create a dmabuf based wl_buffer for it. Let's call that buffer an "Anonymous buffer". But that slightly contradicts with the implementation of the GbmPixmapWayland and the WaylandBufferManagerHost classes. The problem is that the GbmPixmapWayland may not send requests to create dmabuf based wl_buffers if a widget is null. The manager simply fires a gpu termination callback if GbmPixmapWayland sends a request to create a wl_buffer for a null widget. To fix the problem, I had to change the implementation a little bit and allow it to create wl_buffers for null widgets. Now, the GbmPixmapWayland always asks the host manager to create wl_buffers regardless of the AcceleratedWidget's id. And to be able to process these requests, a new logic to store these wl_buffers has been added. Previously, the manager host always delegated creation of WaylandBuffers (which is an internal buffer representation) to surfaces. And whenever wl_buffers were created, AttachWlBuffer was called. Now, the manager may create WaylandBuffers by itself if there is no widget passed and it is impossible to know the surface that must own that buffer. When a CommitBuffer request comes, a surface searches for the buffer in its own container and if it is not found, it asks the WaylandBufferManagerHost to search for an anonymous buffer and pass the ownership of that buffer to that surface. Then, the normal flow continues. Bug: 1008364 Change-Id: I5c582381afc3e16b589d53ceb6ba774ac6da8f5d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1837614 Commit-Queue: Maksim Sisov <msisov@igalia.com> Reviewed-by:Robert Kroeger <rjkroege@chromium.org> Cr-Commit-Position: refs/heads/master@{#702743}
Showing
This diff is collapsed.
Please register or sign in to comment