gl renderer: Sync gpu and cpu default alpha value

Otherwise we might end up not passing the new value to the GPU.
This commit is contained in:
Timm Bäder 2019-04-24 12:56:44 +02:00
parent 34fcfb154a
commit 91bbe6ef95
3 changed files with 19 additions and 3 deletions

View File

@ -2927,11 +2927,11 @@ gsk_gl_renderer_do_render (GskRenderer *renderer,
gsk_gl_glyph_cache_begin_frame (&self->glyph_cache);
gsk_gl_shadow_cache_begin_frame (&self->shadow_cache, self->gl_driver);
memset (&render_op_builder, 0, sizeof (render_op_builder));
/* TODO: REALLY USE ONE BUILDER FOREVER! shader state is not per-frame... */
ops_init (&render_op_builder);
render_op_builder.renderer = self;
render_op_builder.current_projection = projection;
render_op_builder.current_viewport = *viewport;
render_op_builder.current_opacity = 1.0f;
render_op_builder.render_ops = self->render_ops;
ops_set_modelview (&render_op_builder, &modelview,
scale_factor == 1 ? GSK_TRANSFORM_CATEGORY_IDENTITY : GSK_TRANSFORM_CATEGORY_2D_AFFINE);

View File

@ -149,6 +149,22 @@ ops_transform_bounds_modelview (const RenderOpBuilder *builder,
dst->origin.y += builder->dy * head->metadata.scale_y;
}
void
ops_init (RenderOpBuilder *builder)
{
int i;
memset (builder, 0, sizeof (*builder));
builder->current_opacity = 1.0f;
for (i = 0; i < GL_N_PROGRAMS; i ++)
{
builder->program_state[i].opacity = 1.0f;
}
}
void
ops_set_program (RenderOpBuilder *builder,
const Program *program)

View File

@ -277,7 +277,7 @@ void ops_dump_framebuffer (RenderOpBuilder *builder,
const char *filename,
int width,
int height);
void ops_init (RenderOpBuilder *builder);
void ops_finish (RenderOpBuilder *builder);
void ops_push_modelview (RenderOpBuilder *builder,
const graphene_matrix_t *mv,