journal: Support per-framebuffer journals

Instead of having a single journal per context, we now have a
CoglJournal object for each CoglFramebuffer. This means we now don't
have to flush the journal when switching/pushing/popping between
different framebuffers so for example a Clutter scene that involves some
ClutterEffect actors that transiently redirect to an FBO can still be
batched.

This also allows us to track state in the journal that relates to the
current frame of its associated framebuffer which we'll need for our
optimization for using the CPU to handle reading a single pixel back
from a framebuffer when we know the whole scene is currently comprised
of simple rectangles in a journal.
This commit is contained in:
Robert Bragg
2011-01-06 13:25:45 +00:00
parent 5f35bd7b67
commit 1a5a4df326
21 changed files with 375 additions and 101 deletions

View File

@@ -135,6 +135,7 @@ struct _CoglTextureVtable
struct _CoglTexture
{
CoglHandleObject _parent;
GList *framebuffers;
const CoglTextureVtable *vtable;
};
@@ -165,6 +166,10 @@ struct _CoglTexturePixel
guint8 data[4];
};
void
_cogl_texture_init (CoglTexture *texture,
const CoglTextureVtable *vtable);
void
_cogl_texture_free (CoglTexture *texture);
@@ -285,4 +290,14 @@ _cogl_texture_set_region_from_bitmap (CoglHandle handle,
unsigned int dst_height,
CoglBitmap *bmp);
void
_cogl_texture_associate_framebuffer (CoglHandle handle,
CoglFramebuffer *framebuffer);
const GList *
_cogl_texture_get_associated_framebuffers (CoglHandle handle);
void
_cogl_texture_flush_journal_rendering (CoglHandle handle);
#endif /* __COGL_TEXTURE_PRIVATE_H */