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

@ -189,7 +189,7 @@ _cogl_framebuffer_init (CoglFramebuffer *framebuffer,
/* Initialise the clip stack */
_cogl_clip_state_init (&framebuffer->clip_state);
framebuffer->journal = _cogl_journal_new ();
framebuffer->journal = _cogl_journal_new (framebuffer);
/* Ensure we know the framebuffer->clear_color* members can't be
* referenced for our fast-path read-pixel optimization (see
@ -633,7 +633,7 @@ _cogl_framebuffer_remove_all_dependencies (CoglFramebuffer *framebuffer)
void
_cogl_framebuffer_flush_journal (CoglFramebuffer *framebuffer)
{
_cogl_journal_flush (framebuffer->journal, framebuffer);
_cogl_journal_flush (framebuffer->journal);
}
void