Commit Graph

3 Commits

Author SHA1 Message Date
Neil Roberts
39ca3e51df Don't take a reference to the last used onscreen framebuffer
Cogl keeps a pointer to the last used onscreen framebuffer from the
context to implement the deprecated cogl_set_draw_buffer function
which can take COGL_WINDOW_BUFFER as the target to use the last
onscreen buffer. Previously this would also take a reference to that
pointer. However that was causing a circular reference between the
framebuffer and the context which makes it impossible to clean up
resources properly when onscreen buffers are used. This patch instead
changes it to just store the pointer and then clear the pointer during
_cogl_onscreen_free as a kind of cheap weak reference.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2011-11-14 18:40:28 +00:00
Robert Bragg
b72f255c0a Start to reduce dependence on glib
Since we've had several developers from admirable projects say they
would like to use Cogl but would really prefer not to pull in
gobject,gmodule and glib as extra dependencies we are investigating if
we can get to the point where glib is only an optional dependency.
Actually we feel like we only make minimal use of glib anyway, so it may
well be quite straightforward to achieve this.

This adds a --disable-glib configure option that can be used to disable
features that depend on glib.

Actually --disable-glib doesn't strictly disable glib at this point
because it's more helpful if cogl continues to build as we make
incremental progress towards this.

The first use of glib that this patch tackles is the use of
g_return_val_if_fail and g_return_if_fail which have been replaced with
equivalent _COGL_RETURN_VAL_IF_FAIL and _COGL_RETURN_IF_FAIL macros.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2011-11-01 12:03:02 +00:00
Robert Bragg
79719347c8 framebuffer: split out CoglOnscreen code
This factors out the CoglOnscreen code from cogl-framebuffer.c so we now
have cogl-onscreen.c, cogl-onscreen.h and cogl-onscreen-private.h.
Notably some of the functions pulled out are currently namespaced as
cogl_framebuffer but we know we are planning on renaming them to be in
the cogl_onscreen namespace; such as cogl_framebuffer_swap_buffers().

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2011-11-01 12:03:02 +00:00