From 6cf01ff0f49f085e7fc90e0263246ec070bb0e0c Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Tue, 2 Nov 2010 17:34:51 +0000 Subject: [PATCH] cogl-framebuffer: Add a flag to skip flushing the clip state This adds a flag to avoid flushing the clip state when flushing the framebuffer state. This will be used by the journal to manage its own clip state flushing. --- cogl/cogl-framebuffer-private.h | 3 +++ cogl/cogl-framebuffer.c | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cogl/cogl-framebuffer-private.h b/cogl/cogl-framebuffer-private.h index adc2a92bb..1ae102e76 100644 --- a/cogl/cogl-framebuffer-private.h +++ b/cogl/cogl-framebuffer-private.h @@ -122,6 +122,9 @@ typedef enum _CoglFramebufferFlushFlags * be called for framebuffer->modelview_stack, and the modelview_stack will * also be marked as dirty. */ COGL_FRAMEBUFFER_FLUSH_SKIP_MODELVIEW = 1L<<0, + /* Similarly this flag implies you are going to flush the clip state + yourself */ + COGL_FRAMEBUFFER_FLUSH_SKIP_CLIP_STATE = 1L<<1 } CoglFramebufferFlushFlags; void diff --git a/cogl/cogl-framebuffer.c b/cogl/cogl-framebuffer.c index 47b166489..2042c0a38 100644 --- a/cogl/cogl-framebuffer.c +++ b/cogl/cogl-framebuffer.c @@ -783,7 +783,8 @@ _cogl_framebuffer_flush_state (CoglFramebuffer *framebuffer, /* XXX: Flushing clip state may trash the modelview and projection * matrices so we must do it before flushing the matrices... */ - _cogl_clip_state_flush (&framebuffer->clip_state); + if (!(flags & COGL_FRAMEBUFFER_FLUSH_SKIP_CLIP_STATE)) + _cogl_clip_state_flush (&framebuffer->clip_state); if (!(flags & COGL_FRAMEBUFFER_FLUSH_SKIP_MODELVIEW)) _cogl_matrix_stack_flush_to_gl (framebuffer->modelview_stack,