[mutter] cogl: Remove unused CoglFeatureFlags



commit bd1630a12c962665e3e665f3d438855a163e9e9c
Author: Adam Jackson <ajax redhat com>
Date:   Thu Oct 17 21:51:05 2019 -0400

    cogl: Remove unused CoglFeatureFlags
    
    https://gitlab.gnome.org/GNOME/mutter/merge_requests/866

 clutter/clutter/clutter-feature.c           |  6 ++----
 cogl/cogl/cogl-context-private.h            |  1 -
 cogl/cogl/cogl-context.c                    |  1 -
 cogl/cogl/cogl-feature-private.c            |  2 +-
 cogl/cogl/cogl-feature-private.h            |  2 --
 cogl/cogl/cogl-glx-renderer-private.h       |  2 --
 cogl/cogl/cogl-types.h                      |  9 ---------
 cogl/cogl/cogl.c                            | 16 ---------------
 cogl/cogl/cogl.symbols                      |  1 -
 cogl/cogl/cogl1-context.h                   | 30 -----------------------------
 cogl/cogl/driver/gl/gl/cogl-driver-gl.c     |  2 --
 cogl/cogl/driver/gl/gles/cogl-driver-gles.c |  2 --
 cogl/cogl/driver/nop/cogl-driver-nop.c      |  1 -
 cogl/cogl/winsys/cogl-winsys-egl.c          |  2 +-
 cogl/cogl/winsys/cogl-winsys-glx.c          |  5 -----
 cogl/tests/data/valgrind.suppressions       |  8 --------
 src/tests/clutter/clutter-1.0.suppressions  |  8 --------
 17 files changed, 4 insertions(+), 94 deletions(-)
---
diff --git a/clutter/clutter/clutter-feature.c b/clutter/clutter/clutter-feature.c
index db99dcec3..663d1c089 100644
--- a/clutter/clutter/clutter-feature.c
+++ b/clutter/clutter/clutter-feature.c
@@ -33,8 +33,6 @@
  *
  * It is possible to ask whether Clutter has support for specific features at
  * run-time.
- *
- * See also cogl_get_features() and #CoglFeatureFlags
  */
 
 #include "clutter-build-config.h"
@@ -60,7 +58,7 @@ typedef struct ClutterFeatures
 static ClutterFeatures* __features = NULL;
 
 static ClutterFeatureFlags
-clutter_features_from_cogl (guint cogl_flags)
+clutter_features_from_cogl (void)
 {
   ClutterFeatureFlags clutter_flags = 0;
   
@@ -94,7 +92,7 @@ _clutter_feature_init (GError **error)
   if (!_clutter_backend_create_context (context->backend, error))
     return FALSE;
 
-  __features->flags = (clutter_features_from_cogl (cogl_get_features ())
+  __features->flags = (clutter_features_from_cogl ()
                     | _clutter_backend_get_features (context->backend));
 
   __features->features_set = TRUE;
diff --git a/cogl/cogl/cogl-context-private.h b/cogl/cogl/cogl-context-private.h
index 1ce19b23a..426b69166 100644
--- a/cogl/cogl/cogl-context-private.h
+++ b/cogl/cogl/cogl-context-private.h
@@ -97,7 +97,6 @@ struct _CoglContext
 
   /* Features cache */
   unsigned long features[COGL_FLAGS_N_LONGS_FOR_SIZE (_COGL_N_FEATURE_IDS)];
-  CoglFeatureFlags feature_flags; /* legacy/deprecated feature flags */
   unsigned long private_features
     [COGL_FLAGS_N_LONGS_FOR_SIZE (COGL_N_PRIVATE_FEATURES)];
 
diff --git a/cogl/cogl/cogl-context.c b/cogl/cogl/cogl-context.c
index effa4c96f..9a2dca2ba 100644
--- a/cogl/cogl/cogl-context.c
+++ b/cogl/cogl/cogl-context.c
@@ -163,7 +163,6 @@ cogl_context_new (CoglDisplay *display,
 
   /* Init default values */
   memset (context->features, 0, sizeof (context->features));
-  context->feature_flags = 0;
   memset (context->private_features, 0, sizeof (context->private_features));
   memset (context->winsys_features, 0, sizeof (context->winsys_features));
 
diff --git a/cogl/cogl/cogl-feature-private.c b/cogl/cogl/cogl-feature-private.c
index d9271ae2b..3b2a9be98 100644
--- a/cogl/cogl/cogl-feature-private.c
+++ b/cogl/cogl/cogl-feature-private.c
@@ -196,7 +196,7 @@ error:
                        gles_availability,                               \
                        namespaces, extension_names)                     \
   { min_gl_major, min_gl_minor, gles_availability, namespaces,          \
-      extension_names, 0, 0, 0,                                         \
+      extension_names, 0, 0,                                            \
     cogl_ext_ ## name ## _funcs },
 #undef COGL_EXT_FUNCTION
 #define COGL_EXT_FUNCTION(ret, name, args)
diff --git a/cogl/cogl/cogl-feature-private.h b/cogl/cogl/cogl-feature-private.h
index a297cf820..35ec08953 100644
--- a/cogl/cogl/cogl-feature-private.h
+++ b/cogl/cogl/cogl-feature-private.h
@@ -77,8 +77,6 @@ struct _CoglFeatureData
      extension is different from the namespace, you can specify it
      with a ':' after the namespace */
   const char *extension_names;
-  /* A set of feature flags to enable if the extension is available */
-  CoglFeatureFlags feature_flags;
   /* A set of private feature flags to enable if the extension is
    * available */
   int feature_flags_private;
diff --git a/cogl/cogl/cogl-glx-renderer-private.h b/cogl/cogl/cogl-glx-renderer-private.h
index 4a2c880ce..64ccf7c90 100644
--- a/cogl/cogl/cogl-glx-renderer-private.h
+++ b/cogl/cogl/cogl-glx-renderer-private.h
@@ -69,8 +69,6 @@ typedef struct _CoglGLXRenderer
   unsigned long base_winsys_features
     [COGL_FLAGS_N_LONGS_FOR_SIZE (COGL_WINSYS_FEATURE_N_FEATURES)];
 
-  CoglFeatureFlags legacy_feature_flags;
-
   /* Function pointers for core GLX functionality. We can't just link
      against these directly because we need to conditionally load
      libGL when we are using GLX so that it won't conflict with a GLES
diff --git a/cogl/cogl/cogl-types.h b/cogl/cogl/cogl-types.h
index fda46fe01..f3d0b816d 100644
--- a/cogl/cogl/cogl-types.h
+++ b/cogl/cogl/cogl-types.h
@@ -110,15 +110,6 @@ typedef struct _CoglTextureVertex       CoglTextureVertex;
 #define COGL_DEPTH_BIT          (1 << 8)
 #define COGL_STENCIL_BIT        (1 << 9)
 
-/**
- * CoglFeatureFlags:
- *
- * Flags for the supported features.
- *
- * Since: 0.8
- */
-typedef int CoglFeatureFlags;
-
 /**
  * CoglBufferTarget:
  * @COGL_WINDOW_BUFFER: FIXME
diff --git a/cogl/cogl/cogl.c b/cogl/cogl/cogl.c
index b44a08c0b..00796e38b 100644
--- a/cogl/cogl/cogl.c
+++ b/cogl/cogl/cogl.c
@@ -191,22 +191,6 @@ cogl_viewport (unsigned int width,
   cogl_set_viewport (0, 0, width, height);
 }
 
-CoglFeatureFlags
-cogl_get_features (void)
-{
-  _COGL_GET_CONTEXT (ctx, 0);
-
-  return ctx->feature_flags;
-}
-
-gboolean
-cogl_features_available (CoglFeatureFlags features)
-{
-  _COGL_GET_CONTEXT (ctx, 0);
-
-  return (ctx->feature_flags & features) == features;
-}
-
 gboolean
 cogl_has_feature (CoglContext *ctx, CoglFeatureID feature)
 {
diff --git a/cogl/cogl/cogl.symbols b/cogl/cogl/cogl.symbols
index 3a8fae384..5cedeecae 100644
--- a/cogl/cogl/cogl.symbols
+++ b/cogl/cogl/cogl.symbols
@@ -297,7 +297,6 @@ cogl_get_bitmasks
 cogl_get_clock_time
 cogl_get_depth_test_enabled
 cogl_get_draw_framebuffer
-cogl_get_features
 cogl_get_graphics_reset_status
 cogl_get_modelview_matrix
 cogl_get_option_group
diff --git a/cogl/cogl/cogl1-context.h b/cogl/cogl/cogl1-context.h
index 7c3908bbd..0d873fe76 100644
--- a/cogl/cogl/cogl1-context.h
+++ b/cogl/cogl/cogl1-context.h
@@ -61,36 +61,6 @@ GOptionGroup *
 cogl_get_option_group (void);
 
 /* Misc */
-/**
- * cogl_get_features:
- *
- * Returns all of the features supported by COGL.
- *
- * Return value: A logical OR of all the supported COGL features.
- *
- * Since: 0.8
- * Deprecated: 1.10: Use cogl_foreach_feature() instead
- */
-COGL_DEPRECATED_FOR (cogl_foreach_feature)
-CoglFeatureFlags
-cogl_get_features (void);
-
-/**
- * cogl_features_available:
- * @features: A bitmask of features to check for
- *
- * Checks whether the given COGL features are available. Multiple
- * features can be checked for by or-ing them together with the '|'
- * operator. %TRUE is only returned if all of the requested features
- * are available.
- *
- * Return value: %TRUE if the features are available, %FALSE otherwise.
- * Deprecated: 1.10: Use cogl_has_feature() instead
- */
-COGL_DEPRECATED_FOR (cogl_has_feature)
-gboolean
-cogl_features_available (CoglFeatureFlags features);
-
 /**
  * cogl_get_proc_address: (skip)
  * @name: the name of the function.
diff --git a/cogl/cogl/driver/gl/gl/cogl-driver-gl.c b/cogl/cogl/driver/gl/gl/cogl-driver-gl.c
index 069346a60..df6395ea0 100644
--- a/cogl/cogl/driver/gl/gl/cogl-driver-gl.c
+++ b/cogl/cogl/driver/gl/gl/cogl-driver-gl.c
@@ -333,7 +333,6 @@ static gboolean
 _cogl_driver_update_features (CoglContext *ctx,
                               GError **error)
 {
-  CoglFeatureFlags flags = 0;
   unsigned long private_features
     [COGL_FLAGS_N_LONGS_FOR_SIZE (COGL_N_PRIVATE_FEATURES)] = { 0 };
   char **gl_extensions;
@@ -480,7 +479,6 @@ _cogl_driver_update_features (CoglContext *ctx,
   /* Cache features */
   for (i = 0; i < G_N_ELEMENTS (private_features); i++)
     ctx->private_features[i] |= private_features[i];
-  ctx->feature_flags |= flags;
 
   g_strfreev (gl_extensions);
 
diff --git a/cogl/cogl/driver/gl/gles/cogl-driver-gles.c b/cogl/cogl/driver/gl/gles/cogl-driver-gles.c
index 9930d2cd7..b3166cd74 100644
--- a/cogl/cogl/driver/gl/gles/cogl-driver-gles.c
+++ b/cogl/cogl/driver/gl/gles/cogl-driver-gles.c
@@ -242,7 +242,6 @@ _cogl_driver_update_features (CoglContext *context,
 {
   unsigned long private_features
     [COGL_FLAGS_N_LONGS_FOR_SIZE (COGL_N_PRIVATE_FEATURES)] = { 0 };
-  CoglFeatureFlags flags = 0;
   char **gl_extensions;
   int gl_major, gl_minor;
   int i;
@@ -364,7 +363,6 @@ _cogl_driver_update_features (CoglContext *context,
   /* Cache features */
   for (i = 0; i < G_N_ELEMENTS (private_features); i++)
     context->private_features[i] |= private_features[i];
-  context->feature_flags |= flags;
 
   g_strfreev (gl_extensions);
 
diff --git a/cogl/cogl/driver/nop/cogl-driver-nop.c b/cogl/cogl/driver/nop/cogl-driver-nop.c
index 7f3bea03b..a7255a089 100644
--- a/cogl/cogl/driver/nop/cogl-driver-nop.c
+++ b/cogl/cogl/driver/nop/cogl-driver-nop.c
@@ -48,7 +48,6 @@ _cogl_driver_update_features (CoglContext *ctx,
   /* _cogl_gpu_info_init (ctx, &ctx->gpu); */
 
   memset (ctx->private_features, 0, sizeof (ctx->private_features));
-  ctx->feature_flags = 0;
 
   return TRUE;
 }
diff --git a/cogl/cogl/winsys/cogl-winsys-egl.c b/cogl/cogl/winsys/cogl-winsys-egl.c
index e48b65498..03f16fd86 100644
--- a/cogl/cogl/winsys/cogl-winsys-egl.c
+++ b/cogl/cogl/winsys/cogl-winsys-egl.c
@@ -97,7 +97,7 @@
 #define COGL_WINSYS_FEATURE_BEGIN(name, namespaces, extension_names,    \
                                   egl_private_flags)                    \
   { 255, 255, 0, namespaces, extension_names,                           \
-      0, egl_private_flags,                                             \
+      egl_private_flags,                                                \
       0,                                                                \
       cogl_egl_feature_ ## name ## _funcs },
 #undef COGL_WINSYS_FEATURE_FUNCTION
diff --git a/cogl/cogl/winsys/cogl-winsys-glx.c b/cogl/cogl/winsys/cogl-winsys-glx.c
index 6b8239db1..58876601e 100644
--- a/cogl/cogl/winsys/cogl-winsys-glx.c
+++ b/cogl/cogl/winsys/cogl-winsys-glx.c
@@ -142,7 +142,6 @@ typedef struct _CoglTexturePixmapGLX
                                   winsys_feature)                       \
   { major_version, minor_version,                                       \
       0, namespaces, extension_names,                                   \
-      feature_flags,                                                    \
       0,                                                                \
       winsys_feature, \
       cogl_glx_feature_ ## name ## _funcs },
@@ -708,8 +707,6 @@ update_base_winsys_features (CoglRenderer *renderer)
                              split_extensions,
                              glx_renderer))
       {
-        glx_renderer->legacy_feature_flags |=
-          winsys_feature_data[i].feature_flags;
         if (winsys_feature_data[i].winsys_feature)
           COGL_FLAGS_SET (glx_renderer->base_winsys_features,
                           winsys_feature_data[i].winsys_feature,
@@ -830,8 +827,6 @@ update_winsys_features (CoglContext *context, GError **error)
           glx_renderer->base_winsys_features,
           sizeof (context->winsys_features));
 
-  context->feature_flags |= glx_renderer->legacy_feature_flags;
-
   if (glx_renderer->glXCopySubBuffer || context->glBlitFramebuffer)
     {
       CoglGpuInfo *info = &context->gpu;
diff --git a/cogl/tests/data/valgrind.suppressions b/cogl/tests/data/valgrind.suppressions
index f47498d16..b7f82ab30 100644
--- a/cogl/tests/data/valgrind.suppressions
+++ b/cogl/tests/data/valgrind.suppressions
@@ -66,14 +66,6 @@
    fun:g_get_charset
 }
 
-{
-   cogl_features
-   Memcheck:Leak
-   fun:*alloc
-   ...
-   fun:cogl_get_features
-}
-
 {
    glx_query_version
    Memcheck:Leak
diff --git a/src/tests/clutter/clutter-1.0.suppressions b/src/tests/clutter/clutter-1.0.suppressions
index f47498d16..b7f82ab30 100644
--- a/src/tests/clutter/clutter-1.0.suppressions
+++ b/src/tests/clutter/clutter-1.0.suppressions
@@ -66,14 +66,6 @@
    fun:g_get_charset
 }
 
-{
-   cogl_features
-   Memcheck:Leak
-   fun:*alloc
-   ...
-   fun:cogl_get_features
-}
-
 {
    glx_query_version
    Memcheck:Leak


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