[Cogl] [PATCH] pipeline: remove unused _cogl_pipeline_get_layers

Robert Bragg robert at sixbynine.org
Tue Aug 28 08:48:18 PDT 2012


From: Robert Bragg <robert at linux.intel.com>

_cogl_pipeline_get_layers used to be required to support the public
cogl_pipeline_get_layers api but that api has been removed so this
can go too.
---
 cogl/cogl-pipeline-private.h |    8 --------
 cogl/cogl-pipeline.c         |   30 ------------------------------
 2 files changed, 0 insertions(+), 38 deletions(-)

diff --git a/cogl/cogl-pipeline-private.h b/cogl/cogl-pipeline-private.h
index d315b45..26b7cf1 100644
--- a/cogl/cogl-pipeline-private.h
+++ b/cogl/cogl-pipeline-private.h
@@ -451,10 +451,6 @@ struct _CoglPipeline
    * pipelines with only a few layers... */
   CoglPipelineLayer    *short_layers_cache[3];
 
-  /* The deprecated cogl_pipeline_get_layers() API returns a
-   * const GList of layers, which we track here... */
-  GList                *deprecated_get_layers_list;
-
   /* XXX: consider adding an authorities cache to speed up sparse
    * property value lookups:
    * CoglPipeline *authorities_cache[COGL_PIPELINE_N_SPARSE_PROPERTIES];
@@ -484,7 +480,6 @@ struct _CoglPipeline
   unsigned int          real_blend_enable:1;
 
   unsigned int          layers_cache_dirty:1;
-  unsigned int          deprecated_get_layers_list_dirty:1;
 
   /* For debugging purposes it's possible to associate a static const
    * string with a pipeline which can be an aid when trying to trace
@@ -925,9 +920,6 @@ _cogl_pipeline_prune_to_n_layers (CoglPipeline *pipeline, int n);
  * API to support the deprecate cogl_pipeline_layer_xyz functions...
  */
 
-const GList *
-_cogl_pipeline_get_layers (CoglPipeline *pipeline);
-
 typedef CoglBool (*CoglPipelineInternalLayerCallback) (CoglPipelineLayer *layer,
                                                        void *user_data);
 
diff --git a/cogl/cogl-pipeline.c b/cogl/cogl-pipeline.c
index 855d815..fe9b38e 100644
--- a/cogl/cogl-pipeline.c
+++ b/cogl/cogl-pipeline.c
@@ -339,8 +339,6 @@ _cogl_pipeline_copy (CoglPipeline *src, CoglBool is_weak)
    */
 
   pipeline->layers_cache_dirty = TRUE;
-  pipeline->deprecated_get_layers_list = NULL;
-  pipeline->deprecated_get_layers_list_dirty = TRUE;
 
   pipeline->fragend = src->fragend;
 
@@ -458,8 +456,6 @@ _cogl_pipeline_free (CoglPipeline *pipeline)
   if (pipeline->differences & COGL_PIPELINE_STATE_FRAGMENT_SNIPPETS)
     _cogl_pipeline_snippet_list_free (&pipeline->big_state->fragment_snippets);
 
-  g_list_free (pipeline->deprecated_get_layers_list);
-
   recursively_free_layer_caches (pipeline);
 
   g_slice_free (CoglPipeline, pipeline);
@@ -2322,32 +2318,6 @@ prepend_layer_to_list_cb (CoglPipelineLayer *layer,
   return TRUE;
 }
 
-/* TODO: deprecate this API and replace it with
- * cogl_pipeline_foreach_layer
- * TODO: update the docs to note that if the user modifies any layers
- * then the list may become invalid.
- */
-const GList *
-_cogl_pipeline_get_layers (CoglPipeline *pipeline)
-{
-  _COGL_RETURN_VAL_IF_FAIL (cogl_is_pipeline (pipeline), NULL);
-
-  if (!pipeline->deprecated_get_layers_list_dirty)
-    g_list_free (pipeline->deprecated_get_layers_list);
-
-  pipeline->deprecated_get_layers_list = NULL;
-
-  _cogl_pipeline_foreach_layer_internal (pipeline,
-                                         prepend_layer_to_list_cb,
-                                         &pipeline->deprecated_get_layers_list);
-  pipeline->deprecated_get_layers_list =
-    g_list_reverse (pipeline->deprecated_get_layers_list);
-
-  pipeline->deprecated_get_layers_list_dirty = 0;
-
-  return pipeline->deprecated_get_layers_list;
-}
-
 int
 cogl_pipeline_get_n_layers (CoglPipeline *pipeline)
 {
-- 
1.7.7.6



More information about the Cogl mailing list