summaryrefslogtreecommitdiff
path: root/cogl/cogl-journal-private.h
diff options
context:
space:
mode:
authorRobert Bragg <robert@linux.intel.com>2011-01-06 13:25:45 +0000
committerRobert Bragg <robert@linux.intel.com>2011-01-21 16:18:10 +0000
commit1a5a4df3261e1674efb2b53aa738d33fdb53af6c (patch)
tree53fc8cc25142f80414e7f98d450f6bd21135a91a /cogl/cogl-journal-private.h
parent5f35bd7b67d0ff6c942405621891d3f40191bacb (diff)
downloadcogl-1a5a4df3261e1674efb2b53aa738d33fdb53af6c.tar.gz
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.
Diffstat (limited to 'cogl/cogl-journal-private.h')
-rw-r--r--cogl/cogl-journal-private.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/cogl/cogl-journal-private.h b/cogl/cogl-journal-private.h
index a34a5263..754a2ecd 100644
--- a/cogl/cogl-journal-private.h
+++ b/cogl/cogl-journal-private.h
@@ -27,6 +27,16 @@
#include "cogl-handle.h"
#include "cogl-clip-stack.h"
+typedef struct _CoglJournal
+{
+ CoglObject _parent;
+
+ GArray *entries;
+ GArray *vertices;
+ size_t needed_vbo_len;
+
+} CoglJournal;
+
/* To improve batching of geometry when submitting vertices to OpenGL we
* log the texture rectangles we want to draw to a journal, so when we
* later flush the journal we aim to batch data, and gl draw calls. */
@@ -43,8 +53,12 @@ typedef struct _CoglJournalEntry
* later. */
} CoglJournalEntry;
+CoglJournal *
+_cogl_journal_new (void);
+
void
-_cogl_journal_log_quad (const float *position,
+_cogl_journal_log_quad (CoglJournal *journal,
+ const float *position,
CoglPipeline *pipeline,
int n_layers,
CoglHandle layer0_override_texture,
@@ -52,6 +66,7 @@ _cogl_journal_log_quad (const float *position,
unsigned int tex_coords_len);
void
-_cogl_journal_flush (void);
+_cogl_journal_flush (CoglJournal *journal,
+ CoglFramebuffer *framebuffer);
#endif /* __COGL_JOURNAL_PRIVATE_H */