scaled-scene-buffer: reduce unnecessary renderings

Prior to this commit, a backing buffer with scale 1 was always created for
a scaled_scene_buffer before showing it, and backing buffers for specific
scales were created on output_enter events.

This commit removes this redundant re-renderings by calling
wlr_scene_buffer_set_dest_size() upon scaled_scene_buffer creation just to
receive output_enter events and delaying the first rendering to the first
output_enter event.

I needed to add font_get_buffer_size() to obtain the size of a font buffer
without actually creating it.
This commit is contained in:
tokyo4j 2024-12-03 16:18:52 +09:00 committed by Hiroaki Yamamoto
parent cc838e79ed
commit 5db953aa89
6 changed files with 69 additions and 23 deletions

View file

@ -110,7 +110,8 @@ struct scaled_rect_buffer *scaled_rect_buffer_create(
memcpy(self->fill_color, fill_color, sizeof(self->fill_color));
memcpy(self->border_color, border_color, sizeof(self->border_color));
scaled_scene_buffer_invalidate_cache(scaled_buffer);
scaled_scene_buffer_request_update(scaled_buffer,
self->width, self->height);
return self;
}