journal: Always keep a pointer back to the framebuffer

Previously when adding a quad to the journal it would assume the
journal belongs to the framebuffer at the top of the framebuffer stack
and store a reference to that. We eventually want to get rid of the
framebuffer stack so we should avoid using it here. The journal now
takes a pointer back to the framebuffer in its constructor and it
always retains the pointer. As was done previously, the journal still
does not take a reference on the framebuffer unless it is non-empty so
it does not create a permanent circular reference.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
This commit is contained in:
Neil Roberts
2012-03-16 17:26:30 +00:00
parent dc00c27249
commit ff48f3b174
4 changed files with 37 additions and 44 deletions

View File

@ -562,7 +562,7 @@ _cogl_flush_attributes_state (CoglFramebuffer *framebuffer,
CoglContext *ctx = framebuffer->context;
if (!(flags & COGL_DRAW_SKIP_JOURNAL_FLUSH))
_cogl_journal_flush (framebuffer->journal, framebuffer);
_cogl_journal_flush (framebuffer->journal);
layers_state.unit = 0;
layers_state.options.flags = 0;