renderers: Remove internal flush and attach

These were only necessary to allow surface_copy_content to return contents
that included recently attached (but not yet rendered) buffers.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This commit is contained in:
Derek Foreman 2024-06-11 07:02:32 -05:00
parent 0f8bd8dbc5
commit 1fd99807ec
2 changed files with 11 additions and 48 deletions

View File

@ -730,9 +730,10 @@ pixman_renderer_surface_set_color(struct weston_surface *es,
}
static void
pixman_renderer_attach_internal(struct weston_surface *es,
struct weston_buffer *buffer)
pixman_renderer_attach(struct weston_paint_node *pnode)
{
struct weston_surface *es = pnode->surface;
struct weston_buffer *buffer = pnode->surface->buffer_ref.buffer;
struct pixman_surface_state *ps = get_surface_state(es);
struct wl_shm_buffer *shm_buffer;
const struct pixel_format_info *pixel_info;
@ -806,15 +807,6 @@ pixman_renderer_attach_internal(struct weston_surface *es,
&ps->buffer_destroy_listener);
}
static void
pixman_renderer_attach(struct weston_paint_node *pnode)
{
struct weston_surface *es = pnode->surface;
struct weston_buffer *buffer = pnode->surface->buffer_ref.buffer;
pixman_renderer_attach_internal(es, buffer);
}
static void
pixman_renderer_surface_state_destroy(struct pixman_surface_state *ps)
{

View File

@ -2527,9 +2527,9 @@ gl_format_from_internal(GLenum internal_format)
}
static void
gl_renderer_flush_damage_internal(struct weston_surface *surface,
bool just_accumulate)
gl_renderer_flush_damage(struct weston_paint_node *pnode)
{
struct weston_surface *surface = pnode->surface;
const struct weston_testsuite_quirks *quirks =
&surface->compositor->test_data.test_quirks;
struct weston_buffer *buffer = surface->buffer_ref.buffer;
@ -2544,7 +2544,7 @@ gl_renderer_flush_damage_internal(struct weston_surface *surface,
pixman_region32_union(&gb->texture_damage,
&gb->texture_damage, &surface->damage);
if (just_accumulate)
if (pnode->plane != &pnode->output->primary_plane)
return;
/* This can happen if a SHM wl_buffer gets destroyed before we flush
@ -2624,23 +2624,6 @@ done:
weston_buffer_release_reference(&gs->buffer_release_ref, NULL);
}
static void
gl_renderer_flush_damage(struct weston_paint_node *pnode)
{
bool just_accumulate = false;
/* Avoid upload, if the texture won't be used this time.
* We still accumulate the damage in texture_damage, and
* hold the reference to the buffer, in case the surface
* migrates back to the primary plane.
*/
if (pnode->plane != &pnode->output->primary_plane)
just_accumulate = true;
gl_renderer_flush_damage_internal(pnode->surface,
just_accumulate);
}
static void
destroy_buffer_state(struct gl_buffer_state *gb)
{
@ -3597,10 +3580,10 @@ gl_renderer_attach_solid(struct weston_surface *surface,
}
static void
gl_renderer_attach_internal(struct weston_surface *es,
struct weston_buffer *buffer,
struct weston_paint_node *direct_pnode)
gl_renderer_attach(struct weston_paint_node *pnode)
{
struct weston_surface *es = pnode->surface;
struct weston_buffer *buffer = es->buffer_ref.buffer;
struct gl_surface_state *gs = get_surface_state(es);
if (gs->buffer_ref.buffer == buffer)
@ -3625,8 +3608,8 @@ gl_renderer_attach_internal(struct weston_surface *es,
if (!buffer)
goto out;
if (direct_pnode) {
attach_direct_display_placeholder(direct_pnode);
if (pnode->is_direct) {
attach_direct_display_placeholder(pnode);
goto success;
}
@ -3685,18 +3668,6 @@ gl_renderer_buffer_init(struct weston_compositor *etc,
wl_signal_add(&buffer->destroy_signal, &gb->destroy_listener);
}
static void
gl_renderer_attach(struct weston_paint_node *pnode)
{
struct weston_surface *es = pnode->surface;
struct weston_buffer *buffer = es->buffer_ref.buffer;
if (pnode->is_direct)
gl_renderer_attach_internal(es, buffer, pnode);
else
gl_renderer_attach_internal(es, buffer, NULL);
}
static uint32_t
pack_color(pixman_format_code_t format, float *c)
{