cogl-framebuffer: Return gboolean from try_creating_fbo
authorNeil Roberts <neil@linux.intel.com>
Tue, 12 Jan 2010 21:44:40 +0000 (21:44 +0000)
committerNeil Roberts <neil@linux.intel.com>
Thu, 14 Jan 2010 14:10:05 +0000 (14:10 +0000)
commit8247bdf4f9b940fe69165ae6556511fcc9ca3a5d
tree1d962ae99a7f434a12a7bdfe49f48bd0fc5a30c9
parentc6ce9c338966188248c3c1ae7b10480205fe20bf
cogl-framebuffer: Return gboolean from try_creating_fbo

When try_creating_fbo fails it returns 0 to report the error and if it
succeeds it returns ‘flags’. However cogl_offscreen_new_to_texture
also passes in 0 for the flags as the last fallback to create the fbo
with nothing but the color buffer. In that case it will return 0
regardless of whether it succeeded so the last fallback will always be
considered a failure.

To fix this it now just returns a gboolean to indicate whether it
succeeded and the flags used for each attempt is assigned when passing
the argument rather than from the return value of the function.

Also if the only configuration that succeeded was with flags==0 then
it would always try all combinations because last_working_flags would
also be zero. To avoid this it now uses a separate gboolean to mark
whether we found a successful set of flags.

http://bugzilla.openedhand.com/show_bug.cgi?id=1873
clutter/cogl/cogl/cogl-framebuffer.c