diff options
author | Benjamin Otte <otte@redhat.com> | 2010-05-28 12:48:59 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2010-06-07 13:37:47 +0200 |
commit | e20261dddaa194ab4e980da8681e9378d7fd7ef1 (patch) | |
tree | 499d8c7bca456afd0e67eb8f1720d1b7e7a5b26f | |
parent | 8062fb352e6cd1d961f0fbc660779f4ad94c7508 (diff) |
gl: Get rid of operand argument to emit functions
-rw-r--r-- | src/cairo-gl-composite.c | 34 | ||||
-rw-r--r-- | src/cairo-gl-glyphs.c | 2 | ||||
-rw-r--r-- | src/cairo-gl-private.h | 2 | ||||
-rw-r--r-- | src/cairo-gl-surface.c | 11 |
4 files changed, 19 insertions, 30 deletions
diff --git a/src/cairo-gl-composite.c b/src/cairo-gl-composite.c index ecd1b570..59381f7b 100644 --- a/src/cairo-gl-composite.c +++ b/src/cairo-gl-composite.c @@ -1138,7 +1138,6 @@ _cairo_gl_operand_emit (cairo_gl_operand_t *operand, static inline void _cairo_gl_composite_emit_vertex (cairo_gl_context_t *ctx, - cairo_gl_composite_t *setup, GLfloat x, GLfloat y, uint8_t alpha) @@ -1148,15 +1147,14 @@ _cairo_gl_composite_emit_vertex (cairo_gl_context_t *ctx, *vb++ = x; *vb++ = y; - _cairo_gl_operand_emit (&setup->src, &vb, x, y, alpha); - _cairo_gl_operand_emit (&setup->mask, &vb, x, y, alpha); + _cairo_gl_operand_emit (&ctx->operands[CAIRO_GL_TEX_SOURCE], &vb, x, y, alpha); + _cairo_gl_operand_emit (&ctx->operands[CAIRO_GL_TEX_MASK ], &vb, x, y, alpha); ctx->vb_offset += ctx->vertex_size; } void _cairo_gl_composite_emit_rect (cairo_gl_context_t *ctx, - cairo_gl_composite_t *setup, GLfloat x1, GLfloat y1, GLfloat x2, @@ -1165,18 +1163,17 @@ _cairo_gl_composite_emit_rect (cairo_gl_context_t *ctx, { _cairo_gl_composite_prepare_buffer (ctx, 6); - _cairo_gl_composite_emit_vertex (ctx, setup, x1, y1, alpha); - _cairo_gl_composite_emit_vertex (ctx, setup, x2, y1, alpha); - _cairo_gl_composite_emit_vertex (ctx, setup, x1, y2, alpha); + _cairo_gl_composite_emit_vertex (ctx, x1, y1, alpha); + _cairo_gl_composite_emit_vertex (ctx, x2, y1, alpha); + _cairo_gl_composite_emit_vertex (ctx, x1, y2, alpha); - _cairo_gl_composite_emit_vertex (ctx, setup, x2, y1, alpha); - _cairo_gl_composite_emit_vertex (ctx, setup, x2, y2, alpha); - _cairo_gl_composite_emit_vertex (ctx, setup, x1, y2, alpha); + _cairo_gl_composite_emit_vertex (ctx, x2, y1, alpha); + _cairo_gl_composite_emit_vertex (ctx, x2, y2, alpha); + _cairo_gl_composite_emit_vertex (ctx, x1, y2, alpha); } static inline void _cairo_gl_composite_emit_glyph_vertex (cairo_gl_context_t *ctx, - cairo_gl_composite_t *setup, GLfloat x, GLfloat y, GLfloat glyph_x, @@ -1187,7 +1184,7 @@ _cairo_gl_composite_emit_glyph_vertex (cairo_gl_context_t *ctx, *vb++ = x; *vb++ = y; - _cairo_gl_operand_emit (&setup->src, &vb, x, y, 0); + _cairo_gl_operand_emit (&ctx->operands[CAIRO_GL_TEX_SOURCE], &vb, x, y, 0); *vb++ = glyph_x; *vb++ = glyph_y; @@ -1197,7 +1194,6 @@ _cairo_gl_composite_emit_glyph_vertex (cairo_gl_context_t *ctx, void _cairo_gl_composite_emit_glyph (cairo_gl_context_t *ctx, - cairo_gl_composite_t *setup, GLfloat x1, GLfloat y1, GLfloat x2, @@ -1209,13 +1205,13 @@ _cairo_gl_composite_emit_glyph (cairo_gl_context_t *ctx, { _cairo_gl_composite_prepare_buffer (ctx, 6); - _cairo_gl_composite_emit_glyph_vertex (ctx, setup, x1, y1, glyph_x1, glyph_y1); - _cairo_gl_composite_emit_glyph_vertex (ctx, setup, x2, y1, glyph_x2, glyph_y1); - _cairo_gl_composite_emit_glyph_vertex (ctx, setup, x1, y2, glyph_x1, glyph_y2); + _cairo_gl_composite_emit_glyph_vertex (ctx, x1, y1, glyph_x1, glyph_y1); + _cairo_gl_composite_emit_glyph_vertex (ctx, x2, y1, glyph_x2, glyph_y1); + _cairo_gl_composite_emit_glyph_vertex (ctx, x1, y2, glyph_x1, glyph_y2); - _cairo_gl_composite_emit_glyph_vertex (ctx, setup, x2, y1, glyph_x2, glyph_y1); - _cairo_gl_composite_emit_glyph_vertex (ctx, setup, x2, y2, glyph_x2, glyph_y2); - _cairo_gl_composite_emit_glyph_vertex (ctx, setup, x1, y2, glyph_x1, glyph_y2); + _cairo_gl_composite_emit_glyph_vertex (ctx, x2, y1, glyph_x2, glyph_y1); + _cairo_gl_composite_emit_glyph_vertex (ctx, x2, y2, glyph_x2, glyph_y2); + _cairo_gl_composite_emit_glyph_vertex (ctx, x1, y2, glyph_x1, glyph_y2); } void diff --git a/src/cairo-gl-glyphs.c b/src/cairo-gl-glyphs.c index d500785b..91d3c20d 100644 --- a/src/cairo-gl-glyphs.c +++ b/src/cairo-gl-glyphs.c @@ -342,7 +342,7 @@ _render_glyphs (cairo_gl_surface_t *dst, y2 = y1 + scaled_glyph->surface->height; glyph = _cairo_gl_glyph_cache_lock (cache, scaled_glyph); - _cairo_gl_composite_emit_glyph (ctx, &setup, + _cairo_gl_composite_emit_glyph (ctx, x1, y1, x2, y2, glyph->p1.x, glyph->p1.y, glyph->p2.x, glyph->p2.y); diff --git a/src/cairo-gl-private.h b/src/cairo-gl-private.h index 9e653f48..c2a1e13f 100644 --- a/src/cairo-gl-private.h +++ b/src/cairo-gl-private.h @@ -329,7 +329,6 @@ _cairo_gl_composite_begin (cairo_gl_composite_t *setup, cairo_private void _cairo_gl_composite_emit_rect (cairo_gl_context_t *ctx, - cairo_gl_composite_t *setup, GLfloat x1, GLfloat y1, GLfloat x2, @@ -338,7 +337,6 @@ _cairo_gl_composite_emit_rect (cairo_gl_context_t *ctx, cairo_private void _cairo_gl_composite_emit_glyph (cairo_gl_context_t *ctx, - cairo_gl_composite_t *setup, GLfloat x1, GLfloat y1, GLfloat x2, diff --git a/src/cairo-gl-surface.c b/src/cairo-gl-surface.c index 53cba200..f7340ee8 100644 --- a/src/cairo-gl-surface.c +++ b/src/cairo-gl-surface.c @@ -946,13 +946,13 @@ _cairo_gl_surface_composite (cairo_operator_t op, cairo_rectangle_int_t rect; cairo_region_get_rectangle (clip_region, i, &rect); - _cairo_gl_composite_emit_rect (ctx, &setup, + _cairo_gl_composite_emit_rect (ctx, rect.x, rect.y, rect.x + rect.width, rect.y + rect.height, 0); } } else { - _cairo_gl_composite_emit_rect (ctx, &setup, + _cairo_gl_composite_emit_rect (ctx, dst_x, dst_y, dst_x + width, dst_y + height, 0); @@ -1062,7 +1062,7 @@ _cairo_gl_surface_fill_rectangles (void *abstract_dst, goto CLEANUP; for (i = 0; i < num_rects; i++) { - _cairo_gl_composite_emit_rect (ctx, &setup, + _cairo_gl_composite_emit_rect (ctx, rects[i].x, rects[i].y, rects[i].x + rects[i].width, @@ -1103,7 +1103,6 @@ _cairo_gl_render_bounded_spans (void *abstract_renderer, do { if (spans[0].coverage) { _cairo_gl_composite_emit_rect (renderer->ctx, - &renderer->setup, spans[0].x, y, spans[1].x, y + height, spans[0].coverage); @@ -1125,7 +1124,6 @@ _cairo_gl_render_unbounded_spans (void *abstract_renderer, if (num_spans == 0) { _cairo_gl_composite_emit_rect (renderer->ctx, - &renderer->setup, renderer->xmin, y, renderer->xmax, y + height, 0); @@ -1134,7 +1132,6 @@ _cairo_gl_render_unbounded_spans (void *abstract_renderer, if (spans[0].x != renderer->xmin) { _cairo_gl_composite_emit_rect (renderer->ctx, - &renderer->setup, renderer->xmin, y, spans[0].x, y + height, 0); @@ -1142,7 +1139,6 @@ _cairo_gl_render_unbounded_spans (void *abstract_renderer, do { _cairo_gl_composite_emit_rect (renderer->ctx, - &renderer->setup, spans[0].x, y, spans[1].x, y + height, spans[0].coverage); @@ -1151,7 +1147,6 @@ _cairo_gl_render_unbounded_spans (void *abstract_renderer, if (spans[0].x != renderer->xmax) { _cairo_gl_composite_emit_rect (renderer->ctx, - &renderer->setup, spans[0].x, y, renderer->xmax, y + height, 0); |