wlr_scene: More sanity checking

The render list should neither contain scene trees or null buffers.
This commit is contained in:
Alexander Orzechowski 2022-08-28 11:01:19 -04:00 committed by Simon Ser
parent 7333a4602a
commit fe9e193ab5

View file

@ -1043,7 +1043,7 @@ static void scene_node_render(struct wlr_scene_node *node,
enum wl_output_transform transform; enum wl_output_transform transform;
switch (node->type) { switch (node->type) {
case WLR_SCENE_NODE_TREE: case WLR_SCENE_NODE_TREE:
/* Root or tree node has nothing to render itself */ assert(false);
break; break;
case WLR_SCENE_NODE_RECT:; case WLR_SCENE_NODE_RECT:;
struct wlr_scene_rect *scene_rect = scene_rect_from_node(node); struct wlr_scene_rect *scene_rect = scene_rect_from_node(node);
@ -1053,9 +1053,7 @@ static void scene_node_render(struct wlr_scene_node *node,
break; break;
case WLR_SCENE_NODE_BUFFER:; case WLR_SCENE_NODE_BUFFER:;
struct wlr_scene_buffer *scene_buffer = wlr_scene_buffer_from_node(node); struct wlr_scene_buffer *scene_buffer = wlr_scene_buffer_from_node(node);
if (!scene_buffer->buffer) { assert(scene_buffer->buffer);
return;
}
struct wlr_renderer *renderer = output->renderer; struct wlr_renderer *renderer = output->renderer;
texture = scene_buffer_get_texture(scene_buffer, renderer); texture = scene_buffer_get_texture(scene_buffer, renderer);