gl: Get rid of operand argument to emit functions

This commit is contained in:
Benjamin Otte 2010-05-28 12:48:59 +02:00
parent 8062fb352e
commit e20261ddda
4 changed files with 19 additions and 30 deletions

View file

@ -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

View file

@ -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);

View file

@ -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,

View file

@ -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);