[cogl/wip/rib/master-next: 20/44] make COGL_FEATURE_PBOS a private feature



commit 9f035b02d8e1bd78742a014774ba1eb384d8ed8f
Author: Robert Bragg <robert linux intel com>
Date:   Thu Oct 13 09:30:33 2011 +0100

    make COGL_FEATURE_PBOS a private feature
    
    Cogl provides a consistent public interface regardless of whether the
    underlying GL driver supports PBOs so it doesn't make much sense to have
    this feature as part of the public api.  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_PBOS
    which cogl now checks for internally.

 cogl/cogl-context.c      |    2 +-
 cogl/cogl-internal.h     |    3 ++-
 cogl/cogl-pixel-buffer.c |    2 +-
 cogl/driver/gl/cogl-gl.c |    2 +-
 4 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/cogl/cogl-context.c b/cogl/cogl-context.c
index e16957d..4c75c36 100644
--- a/cogl/cogl-context.c
+++ b/cogl/cogl-context.c
@@ -77,7 +77,7 @@ _cogl_init_feature_overrides (CoglContext *ctx)
     ctx->feature_flags &= ~COGL_FEATURE_VBOS;
 
   if (G_UNLIKELY (COGL_DEBUG_ENABLED (COGL_DEBUG_DISABLE_PBOS)))
-    ctx->feature_flags &= ~COGL_FEATURE_PBOS;
+    ctx->private_feature_flags &= ~COGL_PRIVATE_FEATURE_PBOS;
 
   if (G_UNLIKELY (COGL_DEBUG_ENABLED (COGL_DEBUG_DISABLE_ARBFP)))
     ctx->feature_flags &= ~COGL_FEATURE_SHADERS_ARBFP;
diff --git a/cogl/cogl-internal.h b/cogl/cogl-internal.h
index 5c43093..b671868 100644
--- a/cogl/cogl-internal.h
+++ b/cogl/cogl-internal.h
@@ -131,7 +131,8 @@ typedef enum
   COGL_PRIVATE_FEATURE_MESA_PACK_INVERT = 1L<<1,
   COGL_PRIVATE_FEATURE_STENCIL_BUFFER = 1L<<2,
   COGL_PRIVATE_FEATURE_OFFSCREEN_BLIT = 1L<<3,
-  COGL_PRIVATE_FEATURE_FOUR_CLIP_PLANES = 1L<<4
+  COGL_PRIVATE_FEATURE_FOUR_CLIP_PLANES = 1L<<4,
+  COGL_PRIVATE_FEATURE_PBOS = 1L<<5
 } CoglPrivateFeatureFlags;
 
 /* Sometimes when evaluating pipelines, either during comparisons or
diff --git a/cogl/cogl-pixel-buffer.c b/cogl/cogl-pixel-buffer.c
index e8a1b06..e49d4a8 100644
--- a/cogl/cogl-pixel-buffer.c
+++ b/cogl/cogl-pixel-buffer.c
@@ -76,7 +76,7 @@ _cogl_pixel_buffer_new (unsigned int size)
 
   _COGL_GET_CONTEXT (ctx, COGL_INVALID_HANDLE);
 
-  if (!cogl_features_available (COGL_FEATURE_PBOS))
+  if (!(ctx->private_feature_flags & COGL_PRIVATE_FEATURE_PBOS))
     use_malloc = TRUE;
   else
     use_malloc = FALSE;
diff --git a/cogl/driver/gl/cogl-gl.c b/cogl/driver/gl/cogl-gl.c
index adff281..f0a9c4e 100644
--- a/cogl/driver/gl/cogl-gl.c
+++ b/cogl/driver/gl/cogl-gl.c
@@ -200,7 +200,7 @@ _cogl_gl_update_features (CoglContext *context,
 
   if (COGL_CHECK_GL_VERSION (gl_major, gl_minor, 2, 1) ||
       _cogl_check_extension ("GL_EXT_pixel_buffer_object", gl_extensions))
-    flags |= COGL_FEATURE_PBOS;
+    private_flags |= COGL_PRIVATE_FEATURE_PBOS;
 
   if (COGL_CHECK_GL_VERSION (gl_major, gl_minor, 2, 0) ||
       _cogl_check_extension ("GL_ARB_point_sprite", gl_extensions))



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]