From 1b0d0f3892eec816f9dfd78736f5f33d6036b7ac Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Fri, 29 Nov 2013 16:16:37 -0500 Subject: [PATCH] cogl-framebuffer: Don't mark the clear clip dirty from the journal This means that we can't cache the journal read_pixels optimization. https://bugzilla.gnome.org/show_bug.cgi?id=719582 Reviewed-by: Neil Roberts Reviewed-by: Robert Bragg (cherry picked from commit 550bae22d20c8d6d7cf1d090faa9c91619594077) --- cogl/cogl-attribute.c | 1 + cogl/cogl-framebuffer-private.h | 3 +++ cogl/cogl-framebuffer.c | 8 +++++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/cogl/cogl-attribute.c b/cogl/cogl-attribute.c index 49920071e..1bd6b42e3 100644 --- a/cogl/cogl-attribute.c +++ b/cogl/cogl-attribute.c @@ -647,6 +647,7 @@ _cogl_flush_attributes_state (CoglFramebuffer *framebuffer, * in the journal. For this optimization to work we need to track * when the framebuffer really does get drawn to. */ _cogl_framebuffer_mark_mid_scene (framebuffer); + _cogl_framebuffer_mark_clear_clip_dirty (framebuffer); if (G_UNLIKELY (!(flags & COGL_DRAW_SKIP_LEGACY_STATE)) && G_UNLIKELY (ctx->legacy_state_set) && diff --git a/cogl/cogl-framebuffer-private.h b/cogl/cogl-framebuffer-private.h index 52bd1cdff..f7386e11d 100644 --- a/cogl/cogl-framebuffer-private.h +++ b/cogl/cogl-framebuffer-private.h @@ -239,6 +239,9 @@ _cogl_framebuffer_clear_without_flush4f (CoglFramebuffer *framebuffer, float blue, float alpha); +void +_cogl_framebuffer_mark_clear_clip_dirty (CoglFramebuffer *framebuffer); + void _cogl_framebuffer_mark_mid_scene (CoglFramebuffer *framebuffer); diff --git a/cogl/cogl-framebuffer.c b/cogl/cogl-framebuffer.c index 3e5796b34..1e29bffe3 100644 --- a/cogl/cogl-framebuffer.c +++ b/cogl/cogl-framebuffer.c @@ -232,9 +232,14 @@ _cogl_framebuffer_clear_without_flush4f (CoglFramebuffer *framebuffer, } void -_cogl_framebuffer_mark_mid_scene (CoglFramebuffer *framebuffer) +_cogl_framebuffer_mark_clear_clip_dirty (CoglFramebuffer *framebuffer) { framebuffer->clear_clip_dirty = TRUE; +} + +void +_cogl_framebuffer_mark_mid_scene (CoglFramebuffer *framebuffer) +{ framebuffer->mid_scene = TRUE; } @@ -399,6 +404,7 @@ cogl_framebuffer_clear4f (CoglFramebuffer *framebuffer, cleared: _cogl_framebuffer_mark_mid_scene (framebuffer); + _cogl_framebuffer_mark_clear_clip_dirty (framebuffer); if (buffers & COGL_BUFFER_BIT_COLOR && buffers & COGL_BUFFER_BIT_DEPTH) {