mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-09 07:08:07 +02:00
backend-drm: Ignore views with fully transparent solid buffers
Some client use subsurfaces with fully transparent single-pixel buffers for various reasons, such as making it easier to order trees of subsurfaces. As they are invisible we can simply ignore them in the scene graph. This allows us to use direct-scanout/plane-only in more circumstances, as ensured in the test. Signed-off-by: Robert Mader <robert.mader@collabora.com>
This commit is contained in:
parent
1465362e9f
commit
79ade4c165
2 changed files with 9 additions and 4 deletions
|
|
@ -876,6 +876,13 @@ drm_output_propose_state(struct weston_output *output_base,
|
|||
continue;
|
||||
}
|
||||
|
||||
if (pnode->view->alpha == 0.0f ||
|
||||
(pnode->draw_solid && pnode->solid.a == 0.0f)) {
|
||||
drm_debug(b, "\t\t\t\t[view] ignoring view %p " \
|
||||
"(fully transparent)\n", ev);
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Ignore views we know to be totally occluded. */
|
||||
pixman_region32_init(&clipped_view);
|
||||
pixman_region32_intersect(&clipped_view,
|
||||
|
|
|
|||
|
|
@ -211,9 +211,7 @@ TEST(drm_offload_fullscreen) {
|
|||
|
||||
/*
|
||||
* Test that a fullscreen client with fullscreen-sized buffer and a fully
|
||||
* transparent overlay surface is *not* presented via direct-scanout.
|
||||
*
|
||||
* This should be optimized in the future.
|
||||
* transparent overlay surface is presented via direct-scanout.
|
||||
*/
|
||||
TEST(drm_offload_fullscreen_transparent_overlay) {
|
||||
struct xdg_client *xdg_client;
|
||||
|
|
@ -278,7 +276,7 @@ TEST(drm_offload_fullscreen_transparent_overlay) {
|
|||
&result);
|
||||
wl_surface_commit(surface);
|
||||
presentation_wait_nofail(client, &result);
|
||||
test_assert_enum(result, FB_PRESENTED);
|
||||
test_assert_enum(result, FB_PRESENTED_ZERO_COPY);
|
||||
|
||||
wp_viewport_destroy(overlay_viewport);
|
||||
wl_subsurface_destroy(overlay_subsurface);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue