[cogl/wip/neil/primitive-updates: 1/6] Make _cogl_pipeline_get_layer_texture public



commit 00448e4b9ac0bee00171340a5ac37f00467f5946
Author: Neil Roberts <neil linux intel com>
Date:   Sun Feb 5 21:04:14 2012 +0100

    Make _cogl_pipeline_get_layer_texture public
    
    There was no other way to get a pointer to the texture attached to a
    pipeline layer apart from the using the CoglMaterial API but I think
    this was just an oversight so we should add this in. It is already
    maked in the sections file for the gtk-doc.

 cogl/cogl-attribute.c            |    2 +-
 cogl/cogl-pipeline-layer-state.c |    6 ++----
 cogl/cogl-pipeline-layer-state.h |   14 ++++++++++++++
 cogl/cogl-pipeline-private.h     |    4 ----
 cogl/cogl-primitives.c           |    8 ++++----
 5 files changed, 21 insertions(+), 13 deletions(-)
---
diff --git a/cogl/cogl-attribute.c b/cogl/cogl-attribute.c
index 665f265..e8654df 100644
--- a/cogl/cogl-attribute.c
+++ b/cogl/cogl-attribute.c
@@ -323,7 +323,7 @@ validate_layer_cb (CoglPipeline *pipeline,
                    void *user_data)
 {
   CoglTexture *texture =
-    _cogl_pipeline_get_layer_texture (pipeline, layer_index);
+    cogl_pipeline_get_layer_texture (pipeline, layer_index);
   ValidateLayerState *state = user_data;
   gboolean status = TRUE;
 
diff --git a/cogl/cogl-pipeline-layer-state.c b/cogl/cogl-pipeline-layer-state.c
index e12efb8..49e01c8 100644
--- a/cogl/cogl-pipeline-layer-state.c
+++ b/cogl/cogl-pipeline-layer-state.c
@@ -121,8 +121,8 @@ _cogl_pipeline_layer_get_texture_real (CoglPipelineLayer *layer)
 }
 
 CoglTexture *
-_cogl_pipeline_get_layer_texture (CoglPipeline *pipeline,
-                                  int layer_index)
+cogl_pipeline_get_layer_texture (CoglPipeline *pipeline,
+                                 int layer_index)
 {
   CoglPipelineLayer *layer =
     _cogl_pipeline_get_layer (pipeline, layer_index);
@@ -1418,8 +1418,6 @@ cogl_pipeline_set_layer_matrix (CoglPipeline *pipeline,
     }
 }
 
-/* FIXME: deprecate and replace with
- * cogl_pipeline_get_layer_texture() instead. */
 CoglTexture *
 _cogl_pipeline_layer_get_texture (CoglPipelineLayer *layer)
 {
diff --git a/cogl/cogl-pipeline-layer-state.h b/cogl/cogl-pipeline-layer-state.h
index 38d82ee..7c6f7c2 100644
--- a/cogl/cogl-pipeline-layer-state.h
+++ b/cogl/cogl-pipeline-layer-state.h
@@ -143,6 +143,20 @@ cogl_pipeline_set_layer_texture (CoglPipeline *pipeline,
                                  CoglTexture  *texture);
 
 /**
+ * cogl_pipeline_get_layer_texture:
+ * @pipeline: A #CoglPipeline object
+ * @layer_index: the index of the layer
+ *
+ * Return value: the texture that was set for the given layer of the
+ *   pipeline or %NULL if no texture was set.
+ * Stability: unstable
+ * Since: 1.10
+ */
+CoglTexture *
+cogl_pipeline_get_layer_texture (CoglPipeline *pipeline,
+                                 int layer_index);
+
+/**
  * cogl_pipeline_remove_layer:
  * @pipeline: A #CoglPipeline object
  * @layer_index: Specifies the layer you want to remove
diff --git a/cogl/cogl-pipeline-private.h b/cogl/cogl-pipeline-private.h
index f676b1a..5e4f0ff 100644
--- a/cogl/cogl-pipeline-private.h
+++ b/cogl/cogl-pipeline-private.h
@@ -960,10 +960,6 @@ _cogl_pipeline_find_equivalent_parent (CoglPipeline *pipeline,
                                        CoglPipelineState pipeline_state,
                                        CoglPipelineLayerState layer_state);
 
-CoglTexture *
-_cogl_pipeline_get_layer_texture (CoglPipeline *pipeline,
-                                  int layer_index);
-
 void
 _cogl_pipeline_get_layer_combine_constant (CoglPipeline *pipeline,
                                            int layer_index,
diff --git a/cogl/cogl-primitives.c b/cogl/cogl-primitives.c
index be9495c..aca9c20 100644
--- a/cogl/cogl-primitives.c
+++ b/cogl/cogl-primitives.c
@@ -308,7 +308,7 @@ validate_tex_coords_cb (CoglPipeline *pipeline,
 
   state->i++;
 
-  texture = _cogl_pipeline_get_layer_texture (pipeline, layer_index);
+  texture = cogl_pipeline_get_layer_texture (pipeline, layer_index);
 
   /* NB: NULL textures are handled by _cogl_pipeline_flush_gl_state */
   if (!texture)
@@ -534,7 +534,7 @@ _cogl_rectangles_validate_layer_cb (CoglPipeline *pipeline,
    */
   _cogl_pipeline_pre_paint_for_layer (pipeline, layer_index);
 
-  texture = _cogl_pipeline_get_layer_texture (pipeline, layer_index);
+  texture = cogl_pipeline_get_layer_texture (pipeline, layer_index);
 
   /* NULL textures are handled by
    * _cogl_pipeline_flush_gl_state */
@@ -697,7 +697,7 @@ _cogl_rectangles_with_multitexture_coords (
       /* If multitexturing failed or we are drawing with a sliced texture
        * then we only support a single layer so we pluck out the texture
        * from the first pipeline layer... */
-      texture = _cogl_pipeline_get_layer_texture (pipeline, state.first_layer);
+      texture = cogl_pipeline_get_layer_texture (pipeline, state.first_layer);
 
       if (rects[i].tex_coords)
         tex_coords = rects[i].tex_coords;
@@ -904,7 +904,7 @@ append_tex_coord_attributes_cb (CoglPipeline *pipeline,
   /* NULL textures will be handled in
    * _cogl_pipeline_flush_layers_gl_state but there is no need to worry
    * about scaling texture coordinates in this case */
-  texture = _cogl_pipeline_get_layer_texture (pipeline, layer_index);
+  texture = cogl_pipeline_get_layer_texture (pipeline, layer_index);
   if (texture != NULL)
     _cogl_texture_transform_coords_to_gl (texture, &tx, &ty);
 



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