summaryrefslogtreecommitdiff
path: root/cogl/cogl-clip-state.c
diff options
context:
space:
mode:
authorNeil Roberts <neil@linux.intel.com>2010-11-02 17:35:17 +0000
committerNeil Roberts <neil@linux.intel.com>2010-11-04 18:10:09 +0000
commit3c8c1951151f16bedc7e298e2f0a8af536643617 (patch)
tree8e802d686f9508670032ea3b16acbfbd32f38155 /cogl/cogl-clip-state.c
parent6cf01ff0f49f085e7fc90e0263246ec070bb0e0c (diff)
downloadcogl-3c8c1951151f16bedc7e298e2f0a8af536643617.tar.gz
cogl-journal: Log the clip state in the journal
When adding a new entry to the journal a reference is now taken on the current clip stack. Modifying the current clip state no longer causes a journal flush. The journal flushing code now has an extra stage to compare the clip state of each entry. The comparison can simply be done by comparing the pointers. Although different clip states will still end up with multiple draw calls this at leasts allows a scene comprising of multiple different clips to be upload with one vbo. It also lays the groundwork to do certain tricks when drawing clipped rectangles such as modifying the geometry instead of setting a clip state.
Diffstat (limited to 'cogl/cogl-clip-state.c')
-rw-r--r--cogl/cogl-clip-state.c24
1 files changed, 0 insertions, 24 deletions
diff --git a/cogl/cogl-clip-state.c b/cogl/cogl-clip-state.c
index f7fd7d33..e261405a 100644
--- a/cogl/cogl-clip-state.c
+++ b/cogl/cogl-clip-state.c
@@ -51,10 +51,6 @@ cogl_clip_push_window_rectangle (int x_offset,
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
- /* We don't log clip stack changes in the journal so we must flush
- * it before making modifications */
- _cogl_journal_flush ();
-
framebuffer = _cogl_get_framebuffer ();
clip_state = _cogl_framebuffer_get_clip_state (framebuffer);
@@ -136,10 +132,6 @@ cogl_clip_push_rectangle (float x_1,
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
- /* We don't log clip stack changes in the journal so we must flush
- * it before making modifications */
- _cogl_journal_flush ();
-
/* Try and catch window space rectangles so we can redirect to
* cogl_clip_push_window_rect which will use scissoring. */
if (try_pushing_rect_as_window_rect (x_1, y_1, x_2, y_2))
@@ -178,10 +170,6 @@ cogl_clip_push_from_path_preserve (void)
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
- /* We don't log clip stack changes in the journal so we must flush
- * it before making modifications */
- _cogl_journal_flush ();
-
framebuffer = _cogl_get_framebuffer ();
clip_state = _cogl_framebuffer_get_clip_state (framebuffer);
@@ -203,10 +191,6 @@ cogl_clip_push_from_path (void)
static void
_cogl_clip_pop_real (CoglClipState *clip_state)
{
- /* We don't log clip stack changes in the journal so we must flush
- * it before making modifications */
- _cogl_journal_flush ();
-
clip_state->stacks->data = _cogl_clip_stack_pop (clip_state->stacks->data);
}
@@ -250,10 +234,6 @@ cogl_clip_ensure (void)
static void
_cogl_clip_stack_save_real (CoglClipState *clip_state)
{
- /* We don't log clip stack changes in the journal so we must flush
- * it before making modifications */
- _cogl_journal_flush ();
-
clip_state->stacks = g_slist_prepend (clip_state->stacks, NULL);
}
@@ -278,10 +258,6 @@ _cogl_clip_stack_restore_real (CoglClipState *clip_state)
g_return_if_fail (clip_state->stacks != NULL);
- /* We don't log clip stack changes in the journal so we must flush
- * it before making modifications */
- _cogl_journal_flush ();
-
stack = clip_state->stacks->data;
_cogl_clip_stack_unref (stack);