diff options
author | Robert Bragg <robert@linux.intel.com> | 2011-11-21 14:22:01 +0000 |
---|---|---|
committer | Robert Bragg <robert@linux.intel.com> | 2011-12-06 18:51:56 +0000 |
commit | 39a7bcff67b6bd3ec8b14fa269b72e23e1f6cf82 (patch) | |
tree | 976f53b6391201ffd438c4087b03ea11bf0f05b0 /cogl/cogl-clip-stack.c | |
parent | 5156365eae7307ad3e0ae6e6210e2d308d069ca2 (diff) | |
download | cogl-39a7bcff67b6bd3ec8b14fa269b72e23e1f6cf82.tar.gz |
matrix-stack: Avoid referencing the default CoglContext
This removes the use of _COGL_GET_CONTEXT() from cogl-matrix-stack.c
as part of the ongoing effort to evolve cogl to get rid of the need for
a default context.
Reviewed-by: Neil Roberts <neil@linux.intel.com>
Diffstat (limited to 'cogl/cogl-clip-stack.c')
-rw-r--r-- | cogl/cogl-clip-stack.c | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/cogl/cogl-clip-stack.c b/cogl/cogl-clip-stack.c index e3e8340b..b9db676c 100644 --- a/cogl/cogl-clip-stack.c +++ b/cogl/cogl-clip-stack.c @@ -109,7 +109,7 @@ set_clip_plane (CoglFramebuffer *framebuffer, _cogl_matrix_stack_translate (modelview_stack, -vertex_a[0], -vertex_a[1], -vertex_a[2]); - _cogl_matrix_stack_flush_to_gl (modelview_stack, COGL_MATRIX_MODELVIEW); + _cogl_matrix_stack_flush_to_gl (ctx, modelview_stack, COGL_MATRIX_MODELVIEW); planef[0] = 0; planef[1] = -1.0; @@ -210,8 +210,7 @@ add_stencil_clip_rectangle (CoglFramebuffer *framebuffer, _cogl_framebuffer_get_modelview_stack (framebuffer); CoglMatrixStack *projection_stack = _cogl_framebuffer_get_projection_stack (framebuffer); - - _COGL_GET_CONTEXT (ctx, NO_RETVAL); + CoglContext *ctx = cogl_framebuffer_get_context (framebuffer); /* temporarily swap in our special stenciling pipeline */ _cogl_push_source (ctx->stencil_pipeline, FALSE); @@ -219,9 +218,11 @@ add_stencil_clip_rectangle (CoglFramebuffer *framebuffer, /* This can be called from the journal code which doesn't flush the matrix stacks between calls so we need to ensure they're flushed now */ - _cogl_matrix_stack_flush_to_gl (modelview_stack, + _cogl_matrix_stack_flush_to_gl (ctx, + modelview_stack, COGL_MATRIX_MODELVIEW); - _cogl_matrix_stack_flush_to_gl (projection_stack, + _cogl_matrix_stack_flush_to_gl (ctx, + projection_stack, COGL_MATRIX_PROJECTION); if (first) @@ -257,9 +258,11 @@ add_stencil_clip_rectangle (CoglFramebuffer *framebuffer, _cogl_matrix_stack_push (modelview_stack); _cogl_matrix_stack_load_identity (modelview_stack); - _cogl_matrix_stack_flush_to_gl (modelview_stack, + _cogl_matrix_stack_flush_to_gl (ctx, + modelview_stack, COGL_MATRIX_MODELVIEW); - _cogl_matrix_stack_flush_to_gl (projection_stack, + _cogl_matrix_stack_flush_to_gl (ctx, + projection_stack, COGL_MATRIX_PROJECTION); _cogl_rectangle_immediate (-1.0, -1.0, 1.0, 1.0); @@ -298,9 +301,11 @@ add_stencil_clip_silhouette (CoglFramebuffer *framebuffer, /* This can be called from the clip stack code which doesn't flush the matrix stacks between calls so we need to ensure they're flushed now */ - _cogl_matrix_stack_flush_to_gl (modelview_stack, + _cogl_matrix_stack_flush_to_gl (ctx, + modelview_stack, COGL_MATRIX_MODELVIEW); - _cogl_matrix_stack_flush_to_gl (projection_stack, + _cogl_matrix_stack_flush_to_gl (ctx, + projection_stack, COGL_MATRIX_PROJECTION); /* Just setup a simple pipeline that doesn't use texturing... */ @@ -361,12 +366,14 @@ add_stencil_clip_silhouette (CoglFramebuffer *framebuffer, _cogl_matrix_stack_push (projection_stack); _cogl_matrix_stack_load_identity (projection_stack); - _cogl_matrix_stack_flush_to_gl (projection_stack, + _cogl_matrix_stack_flush_to_gl (ctx, + projection_stack, COGL_MATRIX_PROJECTION); _cogl_matrix_stack_push (modelview_stack); _cogl_matrix_stack_load_identity (modelview_stack); - _cogl_matrix_stack_flush_to_gl (modelview_stack, + _cogl_matrix_stack_flush_to_gl (ctx, + modelview_stack, COGL_MATRIX_MODELVIEW); _cogl_rectangle_immediate (-1.0, -1.0, 1.0, 1.0); |