make COGL_FEATURE_OFFSCREEN_BLIT a private feature

Cogl doesn't expose public api for blitting between framebuffers so it
doesn't make much sense to have this feature as part of the public api
currently. We can't break the api by removing the enum but at least we
no longer ever set the feature flag.

We now have a replacement private feature flag
COGL_PRIVATE_FEATURE_OFFSCREEN_BLIT which cogl now checks for
internally.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
This commit is contained in:
Robert Bragg 2011-10-12 22:47:42 +01:00
parent b566170836
commit abbd28f484
6 changed files with 11 additions and 7 deletions

View File

@ -147,7 +147,7 @@ _cogl_blit_framebuffer_begin (CoglBlitData *data)
format and the blit framebuffer extension is supported */
if ((cogl_texture_get_format (data->src_tex) & ~COGL_A_BIT) !=
(cogl_texture_get_format (data->dst_tex) & ~COGL_A_BIT) ||
!cogl_features_available (COGL_FEATURE_OFFSCREEN_BLIT))
!(ctx->private_feature_flags & COGL_PRIVATE_FEATURE_OFFSCREEN_BLIT))
return FALSE;
dst_fbo = _cogl_offscreen_new_to_texture_full

View File

@ -307,7 +307,7 @@ _cogl_push_framebuffers (CoglFramebuffer *draw_buffer,
* This blits a region of the color buffer of the current draw buffer
* to the current read buffer. The draw and read buffers can be set up
* using _cogl_push_framebuffers(). This function should only be
* called if the COGL_FEATURE_OFFSCREEN_BLIT feature is
* called if the COGL_PRIVATE_FEATURE_OFFSCREEN_BLIT feature is
* advertised. The two buffers must both be offscreen and have the
* same format.
*

View File

@ -1494,7 +1494,8 @@ _cogl_framebuffer_flush_state (CoglFramebuffer *draw_buffer,
/* NB: Currently we only take advantage of binding separate
* read/write buffers for offscreen framebuffer blit
* purposes. */
g_return_if_fail (cogl_features_available (COGL_FEATURE_OFFSCREEN_BLIT));
g_return_if_fail (ctx->private_feature_flags &
COGL_PRIVATE_FEATURE_OFFSCREEN_BLIT);
g_return_if_fail (draw_buffer->type == COGL_FRAMEBUFFER_TYPE_OFFSCREEN);
g_return_if_fail (read_buffer->type == COGL_FRAMEBUFFER_TYPE_OFFSCREEN);
@ -1783,7 +1784,9 @@ _cogl_blit_framebuffer (unsigned int src_x,
read_buffer = _cogl_get_read_framebuffer ();
ctx = draw_buffer->context;
g_return_if_fail (cogl_features_available (COGL_FEATURE_OFFSCREEN_BLIT));
g_return_if_fail (ctx->private_feature_flags &
COGL_PRIVATE_FEATURE_OFFSCREEN_BLIT);
/* We can only support blitting between offscreen buffers because
otherwise we would need to mirror the image and GLES2.0 doesn't
support this */

View File

@ -129,7 +129,8 @@ typedef enum
{
COGL_PRIVATE_FEATURE_TEXTURE_2D_FROM_EGL_IMAGE = 1L<<0,
COGL_PRIVATE_FEATURE_MESA_PACK_INVERT = 1L<<1,
COGL_PRIVATE_FEATURE_STENCIL_BUFFER = 1L<<2
COGL_PRIVATE_FEATURE_STENCIL_BUFFER = 1L<<2,
COGL_PRIVATE_FEATURE_OFFSCREEN_BLIT = 1L<<3
} CoglPrivateFeatureFlags;
/* Sometimes when evaluating pipelines, either during comparisons or

View File

@ -193,7 +193,7 @@ _cogl_gl_update_features (CoglContext *context,
flags |= COGL_FEATURE_OFFSCREEN;
if (context->glBlitFramebuffer)
flags |= COGL_FEATURE_OFFSCREEN_BLIT;
private_flags |= COGL_PRIVATE_FEATURE_OFFSCREEN_BLIT;
if (context->glRenderbufferStorageMultisampleIMG)
flags |= COGL_FEATURE_OFFSCREEN_MULTISAMPLE;

View File

@ -100,7 +100,7 @@ _cogl_gles_update_features (CoglContext *context,
flags |= COGL_FEATURE_OFFSCREEN;
if (context->glBlitFramebuffer)
flags |= COGL_FEATURE_OFFSCREEN_BLIT;
private_flags |= COGL_PRIVATE_FEATURE_OFFSCREEN_BLIT;
if (_cogl_check_extension ("GL_OES_element_index_uint", gl_extensions))
flags |= COGL_FEATURE_UNSIGNED_INT_INDICES;