scene: Move single-pixel buffer things to scene_buffer

Move single-pixel buffer status cache from wlr_scene_surface to
wlr_scene_buffer, it makes more sense there and means the optimisations
will still work if wlr_scene_buffer is used without wlr_scene_surface.
This commit is contained in:
David Turner 2025-04-10 14:36:08 +01:00 committed by Simon Ser
parent c450991c4b
commit 0bf0c55ad2
3 changed files with 38 additions and 39 deletions

View file

@ -132,12 +132,6 @@ struct wlr_scene_surface {
struct wl_listener frame_done;
struct wl_listener surface_destroy;
struct wl_listener surface_commit;
// True if the underlying buffer is a wlr_single_pixel_buffer_v1
bool is_single_pixel_buffer;
// If is_single_pixel_buffer is set, contains the color of the buffer
// as {R, G, B, A} where the max value of each component is UINT32_MAX
uint32_t single_pixel_buffer_color[4];
} WLR_PRIVATE;
};
@ -205,6 +199,12 @@ struct wlr_scene_buffer {
struct wl_listener buffer_release;
struct wl_listener renderer_destroy;
// True if the underlying buffer is a wlr_single_pixel_buffer_v1
bool is_single_pixel_buffer;
// If is_single_pixel_buffer is set, contains the color of the buffer
// as {R, G, B, A} where the max value of each component is UINT32_MAX
uint32_t single_pixel_buffer_color[4];
} WLR_PRIVATE;
};