summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2010-04-19 23:18:04 +0200
committerBenjamin Otte <otte@redhat.com>2010-04-23 23:34:45 +0200
commit9fbbee95e275734360e7e91a5c88bf77ab2987eb (patch)
tree34992a647f530ef3d30c62ae6de31e4abb86ddc4
parent263d7eaf860b84a99d31a7aae2ba11148571d03f (diff)
gl: Make _gl_set_destination() take the context as an argument
Keeping with the API introduced for Xlib, functions that require an acquired context take this context as the first argument.
-rw-r--r--src/cairo-gl-glyphs.c2
-rw-r--r--src/cairo-gl-private.h2
-rw-r--r--src/cairo-gl-surface.c20
3 files changed, 11 insertions, 13 deletions
diff --git a/src/cairo-gl-glyphs.c b/src/cairo-gl-glyphs.c
index e3f8f80a..c0a52058 100644
--- a/src/cairo-gl-glyphs.c
+++ b/src/cairo-gl-glyphs.c
@@ -469,7 +469,7 @@ _render_glyphs (cairo_gl_surface_t *dst,
if (unlikely (status))
return status;
- _cairo_gl_set_destination (dst);
+ _cairo_gl_set_destination (ctx, dst);
_cairo_scaled_font_freeze_cache (scaled_font);
if (! _cairo_gl_surface_owns_font (dst, scaled_font)) {
diff --git a/src/cairo-gl-private.h b/src/cairo-gl-private.h
index 90f0ebaf..d5f705d2 100644
--- a/src/cairo-gl-private.h
+++ b/src/cairo-gl-private.h
@@ -246,7 +246,7 @@ _cairo_gl_context_release (cairo_gl_context_t *ctx)
}
cairo_private void
-_cairo_gl_set_destination (cairo_gl_surface_t *surface);
+_cairo_gl_set_destination (cairo_gl_context_t *ctx, cairo_gl_surface_t *surface);
cairo_private cairo_bool_t
_cairo_gl_operator_is_supported (cairo_operator_t op);
diff --git a/src/cairo-gl-surface.c b/src/cairo-gl-surface.c
index 7af90175..e73dd514 100644
--- a/src/cairo-gl-surface.c
+++ b/src/cairo-gl-surface.c
@@ -324,10 +324,8 @@ _cairo_gl_get_image_format_and_type (pixman_format_code_t pixman_format,
}
void
-_cairo_gl_set_destination (cairo_gl_surface_t *surface)
+_cairo_gl_set_destination (cairo_gl_context_t *ctx, cairo_gl_surface_t *surface)
{
- cairo_gl_context_t *ctx = (cairo_gl_context_t *) surface->base.device;
-
if (ctx->current_target != surface) {
ctx->current_target = surface;
@@ -575,7 +573,7 @@ _cairo_gl_surface_clear (cairo_gl_surface_t *surface)
if (unlikely (status))
return status;
- _cairo_gl_set_destination (surface);
+ _cairo_gl_set_destination (ctx, surface);
if (surface->base.content == CAIRO_CONTENT_COLOR)
glClearColor (0.0, 0.0, 0.0, 1.0);
else
@@ -884,7 +882,7 @@ _cairo_gl_surface_draw_image (cairo_gl_surface_t *dst,
glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
}
- _cairo_gl_set_destination (dst);
+ _cairo_gl_set_destination (ctx, dst);
glGenTextures (1, &tex);
glActiveTexture (GL_TEXTURE0);
@@ -1004,7 +1002,7 @@ _cairo_gl_surface_get_image (cairo_gl_surface_t *surface,
status = _cairo_gl_context_acquire (surface->base.device, &ctx);
if (unlikely (status))
return status;
- _cairo_gl_set_destination (surface);
+ _cairo_gl_set_destination (ctx, surface);
glPixelStorei (GL_PACK_ALIGNMENT, 1);
glPixelStorei (GL_PACK_ROW_LENGTH, pixman_image_get_stride (image->pixman_image) / cpp);
@@ -2094,7 +2092,7 @@ _cairo_gl_surface_composite_component_alpha (cairo_operator_t op,
status = CAIRO_STATUS_SUCCESS;
}
- _cairo_gl_set_destination (dst);
+ _cairo_gl_set_destination (ctx, dst);
if (clip_region != NULL) {
int num_rectangles;
@@ -2312,7 +2310,7 @@ _cairo_gl_surface_composite (cairo_operator_t op,
status = CAIRO_STATUS_SUCCESS;
}
- _cairo_gl_set_destination (dst);
+ _cairo_gl_set_destination (ctx, dst);
_cairo_gl_set_operator (dst, op, FALSE);
_cairo_gl_use_program (setup.shader);
@@ -2550,7 +2548,7 @@ _cairo_gl_surface_fill_rectangles_fixed (void *abstract_surface,
if (unlikely (status))
return status;
- _cairo_gl_set_destination (surface);
+ _cairo_gl_set_destination (ctx, surface);
_cairo_gl_set_operator (surface, op, FALSE);
if (num_rects > N_STACK_RECTS) {
@@ -2667,7 +2665,7 @@ _cairo_gl_surface_fill_rectangles_glsl (void *abstract_surface,
_cairo_gl_use_program (&ctx->fill_rectangles_shader);
- _cairo_gl_set_destination (surface);
+ _cairo_gl_set_destination (ctx, surface);
_cairo_gl_set_operator (surface, op, FALSE);
status = bind_vec4_to_shader (ctx->fill_rectangles_shader.program,
@@ -3054,7 +3052,7 @@ _cairo_gl_surface_create_span_renderer (cairo_operator_t op,
free (renderer);
return _cairo_span_renderer_create_in_error (status);
}
- _cairo_gl_set_destination (dst);
+ _cairo_gl_set_destination (ctx, dst);
status = _cairo_gl_get_program (renderer->ctx,
renderer->setup.src.source,