mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-01-10 12:50:19 +01:00
gl: Properly disable ctx->spans when necessary
When compositing starts, if we are not using the spans compositor, we should set the spans member of the context to false.
This commit is contained in:
parent
18e7234c7e
commit
3bedff0c00
1 changed files with 10 additions and 4 deletions
|
|
@ -266,11 +266,18 @@ _cairo_gl_context_setup_operand (cairo_gl_context_t *ctx,
|
|||
|
||||
static void
|
||||
_cairo_gl_context_setup_spans (cairo_gl_context_t *ctx,
|
||||
cairo_bool_t spans_enabled,
|
||||
unsigned int vertex_size,
|
||||
unsigned int vertex_offset)
|
||||
{
|
||||
cairo_gl_dispatch_t *dispatch = &ctx->dispatch;
|
||||
|
||||
if (! spans_enabled) {
|
||||
dispatch->DisableVertexAttribArray (CAIRO_GL_COLOR_ATTRIB_INDEX);
|
||||
ctx->spans = FALSE;
|
||||
return;
|
||||
}
|
||||
|
||||
dispatch->VertexAttribPointer (CAIRO_GL_COLOR_ATTRIB_INDEX, 4,
|
||||
GL_UNSIGNED_BYTE, GL_TRUE, vertex_size,
|
||||
ctx->vb + vertex_offset);
|
||||
|
|
@ -681,10 +688,9 @@ _cairo_gl_composite_begin_multisample (cairo_gl_composite_t *setup,
|
|||
|
||||
_cairo_gl_context_setup_operand (ctx, CAIRO_GL_TEX_SOURCE, &setup->src, vertex_size, dst_size);
|
||||
_cairo_gl_context_setup_operand (ctx, CAIRO_GL_TEX_MASK, &setup->mask, vertex_size, dst_size + src_size);
|
||||
if (setup->spans)
|
||||
_cairo_gl_context_setup_spans (ctx, vertex_size, dst_size + src_size + mask_size);
|
||||
else
|
||||
ctx->dispatch.DisableVertexAttribArray (CAIRO_GL_COLOR_ATTRIB_INDEX);
|
||||
|
||||
_cairo_gl_context_setup_spans (ctx, setup->spans, vertex_size,
|
||||
dst_size + src_size + mask_size);
|
||||
|
||||
_cairo_gl_set_operator (ctx, setup->op, component_alpha);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue