From 6ab371d587e22ac5807f9224cd420c43168a803f Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Tue, 22 Nov 2011 19:35:31 +0000 Subject: [PATCH] clip-state: remove redundant _cogl_clip_state_flush() api There was only one place where we called _cogl_clip_state_flush() in _cogl_framebuffer_flush_state() and we can just as well use _cogl_clip_state_get_stack() and _cogl_clip_stack_flush() directly instead. Reviewed-by: Neil Roberts --- cogl/cogl-clip-state-private.h | 4 ---- cogl/cogl-clip-state.c | 10 ---------- cogl/cogl-framebuffer.c | 7 +++++-- 3 files changed, 5 insertions(+), 16 deletions(-) diff --git a/cogl/cogl-clip-state-private.h b/cogl/cogl-clip-state-private.h index 799302ffd..e5e1488e0 100644 --- a/cogl/cogl-clip-state-private.h +++ b/cogl/cogl-clip-state-private.h @@ -40,10 +40,6 @@ _cogl_clip_state_init (CoglClipState *state); void _cogl_clip_state_destroy (CoglClipState *state); -void -_cogl_clip_state_flush (CoglClipState *clip_state, - CoglFramebuffer *framebuffer); - CoglClipStack * _cogl_clip_state_get_stack (CoglClipState *clip_state); diff --git a/cogl/cogl-clip-state.c b/cogl/cogl-clip-state.c index 229e6ad12..8a1013f8d 100644 --- a/cogl/cogl-clip-state.c +++ b/cogl/cogl-clip-state.c @@ -203,13 +203,3 @@ _cogl_clip_state_restore_clip_stack (CoglClipState *clip_state) clip_state->stacks = g_slist_delete_link (clip_state->stacks, clip_state->stacks); } - -void -_cogl_clip_state_flush (CoglClipState *clip_state, - CoglFramebuffer *framebuffer) -{ - /* Flush the topmost stack. The clip stack code will bail out early - if this is already flushed */ - _cogl_clip_stack_flush (clip_state->stacks->data, - framebuffer); -} diff --git a/cogl/cogl-framebuffer.c b/cogl/cogl-framebuffer.c index a7b0e0865..c92fc747d 100644 --- a/cogl/cogl-framebuffer.c +++ b/cogl/cogl-framebuffer.c @@ -1446,8 +1446,11 @@ _cogl_framebuffer_flush_state (CoglFramebuffer *draw_buffer, * matrices so we must do it before flushing the matrices... */ if (!(flags & COGL_FRAMEBUFFER_FLUSH_SKIP_CLIP_STATE)) - _cogl_clip_state_flush (&draw_buffer->clip_state, - draw_buffer); + { + CoglClipStack *stack = + _cogl_clip_state_get_stack (&draw_buffer->clip_state); + _cogl_clip_stack_flush (stack); + } if (!(flags & COGL_FRAMEBUFFER_FLUSH_SKIP_MODELVIEW)) _cogl_matrix_stack_flush_to_gl (draw_buffer->modelview_stack,