scene/surface: simplify single-pixel-buffer check in surface_reconfigure()

No need to call wlr_client_buffer_get() on wlr_client_buffer.base:
we're already manipulating a wlr_client_buffer.

(cherry picked from commit b62c6878e1)
This commit is contained in:
Simon Ser 2025-08-03 17:25:05 +02:00 committed by Simon Zeni
parent 73aa61686f
commit bb5180ce9e

View file

@ -175,10 +175,9 @@ static void surface_reconfigure(struct wlr_scene_surface *scene_surface) {
// can't use the cached scene_buffer->is_single_pixel_buffer
// because that's only set later on.
bool is_single_pixel_buffer = false;
struct wlr_client_buffer *client_buffer = wlr_client_buffer_get(&surface->buffer->base);
if (client_buffer != NULL && client_buffer->source != NULL) {
if (surface->buffer->source != NULL) {
struct wlr_single_pixel_buffer_v1 *spb =
wlr_single_pixel_buffer_v1_try_from_buffer(client_buffer->source);
wlr_single_pixel_buffer_v1_try_from_buffer(surface->buffer->source);
is_single_pixel_buffer = spb != NULL;
}
if (!is_single_pixel_buffer) {