[cogl/wip/rib/master-next: 17/35] make COGL_FEATURE_STENCIL_BUFFER private



commit feef2c3d3ec133d1b1166ecdb78c75926bccf3ea
Author: Robert Bragg <robert linux intel com>
Date:   Wed Oct 12 22:37:29 2011 +0100

    make COGL_FEATURE_STENCIL_BUFFER private
    
    Although we have to leave the COGL_FEATURE_STENCIL_BUFFER enum as part
    of the public api we no longer ever set this feature flag.
    
    Cogl doesn't currently expose the concept of a stencil buffer in the
    public api (we only indirectly expose it via the clip stack api) so it
    doesn't make much sense to have a stencil buffer feature flag.
    
    We now have a COGL_PRIVATE_FEATURE_STENCIL_BUFFER flag instead which
    we can check when we need to use the buffer for clipping.

 cogl/cogl-internal.h         |    3 ++-
 cogl/cogl2-path.c            |    2 +-
 cogl/driver/gl/cogl-gl.c     |    2 +-
 cogl/driver/gles/cogl-gles.c |    2 +-
 4 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/cogl/cogl-internal.h b/cogl/cogl-internal.h
index eee0e08..ae53067 100644
--- a/cogl/cogl-internal.h
+++ b/cogl/cogl-internal.h
@@ -128,7 +128,8 @@ typedef enum
 typedef enum
 {
   COGL_PRIVATE_FEATURE_TEXTURE_2D_FROM_EGL_IMAGE = 1L<<0,
-  COGL_PRIVATE_FEATURE_MESA_PACK_INVERT = 1L<<1
+  COGL_PRIVATE_FEATURE_MESA_PACK_INVERT = 1L<<1,
+  COGL_PRIVATE_FEATURE_STENCIL_BUFFER = 1L<<2
 } CoglPrivateFeatureFlags;
 
 /* Sometimes when evaluating pipelines, either during comparisons or
diff --git a/cogl/cogl2-path.c b/cogl/cogl2-path.c
index e3143a0..e430488 100644
--- a/cogl/cogl2-path.c
+++ b/cogl/cogl2-path.c
@@ -273,7 +273,7 @@ _cogl_path_fill_nodes_with_clipped_rectangle (CoglPath *path)
 {
   _COGL_GET_CONTEXT (ctx, NO_RETVAL);
 
-  if (!cogl_features_available (COGL_FEATURE_STENCIL_BUFFER))
+  if (!(ctx->private_feature_flags & COGL_PRIVATE_FEATURE_STENCIL_BUFFER))
     {
       static gboolean seen_warning = FALSE;
 
diff --git a/cogl/driver/gl/cogl-gl.c b/cogl/driver/gl/cogl-gl.c
index a651429..4dae170 100644
--- a/cogl/driver/gl/cogl-gl.c
+++ b/cogl/driver/gl/cogl-gl.c
@@ -183,7 +183,7 @@ _cogl_gl_update_features (CoglContext *context,
   GE( ctx, glGetIntegerv (GL_STENCIL_BITS, &num_stencil_bits) );
   /* We need at least three stencil bits to combine clips */
   if (num_stencil_bits > 2)
-    flags |= COGL_FEATURE_STENCIL_BUFFER;
+    private_flags |= COGL_PRIVATE_FEATURE_STENCIL_BUFFER;
 
   GE( ctx, glGetIntegerv (GL_MAX_CLIP_PLANES, &max_clip_planes) );
   if (max_clip_planes >= 4)
diff --git a/cogl/driver/gles/cogl-gles.c b/cogl/driver/gles/cogl-gles.c
index 1dbe433..67ab5ae 100644
--- a/cogl/driver/gles/cogl-gles.c
+++ b/cogl/driver/gles/cogl-gles.c
@@ -70,7 +70,7 @@ _cogl_gles_update_features (CoglContext *context,
   GE( context, glGetIntegerv (GL_STENCIL_BITS, &num_stencil_bits) );
   /* We need at least three stencil bits to combine clips */
   if (num_stencil_bits > 2)
-    flags |= COGL_FEATURE_STENCIL_BUFFER;
+    private_flags |= COGL_PRIVATE_FEATURE_STENCIL_BUFFER;
 
 #ifdef HAVE_COGL_GLES
   if (context->driver == COGL_DRIVER_GLES1)



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