diff options
author | Owen W. Taylor <otaylor@fishsoup.net> | 2012-11-12 11:58:10 -0500 |
---|---|---|
committer | Robert Bragg <robert@linux.intel.com> | 2013-01-30 20:09:49 +0000 |
commit | 24733abf68ba326e415c6a17c0c1e59c3d303003 (patch) | |
tree | 5bd72440a72560dafaf764fc15c98018c3eea2a1 /cogl/cogl-context-private.h | |
parent | 5ce058c0e5cdbccdbfc4bff5b41023951ba549ab (diff) | |
download | cogl-24733abf68ba326e415c6a17c0c1e59c3d303003.tar.gz |
onscreen: Add CoglFrameInfo and _add_frame_callback() api
Add a CoglFrameInfo object that tracks timing information for frames
that are drawn. We track a frame counter and frame timing information
for each CoglOnscreen. Internally a CoglFrameInfo is automatically
created for each frame, delimited by cogl_onscreen_swap_buffers() or
cogl_onscreen_swap_region() calls.
CoglFrameInfos are delivered to applications via frame event callbacks
that can be registered with a new cogl_onscreen_add_frame_callback()
api. Two initial event types (dispatched on all platforms) have been
defined; a _SYNC event used for throttling the frame rate of
applications and a _COMPLETE event used so signify the end of a frame.
Note: This new _add_frame_callback() api makes the
cogl_onscreen_add_swap_complete_callback() api redundant and so it
should be considered deprecated. Since the _add_swap_complete_callback()
api is still experimental api, we will be looking to quickly migrate
users to the new api so we can remove the old api.
Reviewed-by: Robert Bragg <robert@linux.intel.com>
(cherry picked from commit 700401667db2522045e4623d78797b17f9184501)
Diffstat (limited to 'cogl/cogl-context-private.h')
-rw-r--r-- | cogl/cogl-context-private.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/cogl/cogl-context-private.h b/cogl/cogl-context-private.h index 2780a59d..4c383545 100644 --- a/cogl/cogl-context-private.h +++ b/cogl/cogl-context-private.h @@ -50,6 +50,7 @@ #include "cogl-gpu-info-private.h" #include "cogl-gl-header.h" #include "cogl-framebuffer-private.h" +#include "cogl-onscreen-private.h" typedef struct { @@ -190,6 +191,11 @@ struct _CoglContext gboolean have_last_offscreen_allocate_flags; CoglOffscreenAllocateFlags last_offscreen_allocate_flags; + GHashTable *swap_callback_closures; + int next_swap_callback_id; + + CoglOnscreenEventList onscreen_events_queue; + CoglGLES2Context *current_gles2_context; GQueue gles2_context_stack; |