diff --git a/cogl/cogl-framebuffer.c b/cogl/cogl-framebuffer.c index a86e4a68a..55ae80988 100644 --- a/cogl/cogl-framebuffer.c +++ b/cogl/cogl-framebuffer.c @@ -1549,6 +1549,14 @@ cogl_framebuffer_set_dither_enabled (CoglFramebuffer *framebuffer, framebuffer->dither_enabled = dither_enabled; } +CoglContext * +cogl_framebuffer_get_context (CoglFramebuffer *framebuffer) +{ + g_return_val_if_fail (framebuffer != NULL, NULL); + + return framebuffer->context; +} + gboolean _cogl_framebuffer_try_fast_read_pixel (CoglFramebuffer *framebuffer, int x, diff --git a/cogl/cogl-framebuffer.h b/cogl/cogl-framebuffer.h index c8c7a35d8..aa5d0788b 100644 --- a/cogl/cogl-framebuffer.h +++ b/cogl/cogl-framebuffer.h @@ -261,6 +261,22 @@ void cogl_framebuffer_set_color_mask (CoglFramebuffer *framebuffer, CoglColorMask color_mask); +#define cogl_framebuffer_get_context cogl_framebuffer_get_context_EXP +/** + * @framebuffer: A #CoglFramebuffer + * + * Can be used to query the #CoglContext a given @framebuffer was + * instantiated within. This is the #CoglContext that was passed to + * cogl_onscreen_new() for example. + * + * Return value: The #CoglContext that the given @framebuffer was + * instantiated within. + * Since: 1.8 + * Stability: unstable + */ +CoglContext * +cogl_framebuffer_get_context (CoglFramebuffer *framebuffer); + #define cogl_framebuffer_swap_buffers cogl_framebuffer_swap_buffers_EXP void cogl_framebuffer_swap_buffers (CoglFramebuffer *framebuffer); diff --git a/doc/reference/cogl-2.0-experimental/cogl-2.0-experimental-sections.txt b/doc/reference/cogl-2.0-experimental/cogl-2.0-experimental-sections.txt index 476bc9eca..382dcd463 100644 --- a/doc/reference/cogl-2.0-experimental/cogl-2.0-experimental-sections.txt +++ b/doc/reference/cogl-2.0-experimental/cogl-2.0-experimental-sections.txt @@ -322,6 +322,7 @@ cogl_framebuffer_get_blue_bits cogl_framebuffer_get_blue_bits cogl_framebuffer_get_color_mask cogl_framebuffer_set_color_mask +cogl_framebuffer_get_context cogl_framebuffer_swap_buffers cogl_framebuffer_swap_region cogl_framebuffer_add_swap_buffers_callback