[cogl] context: removes some uses of CoglHandle



commit 0a2a3d7c80049450373ac24a219c556c55a04da7
Author: Robert Bragg <robert linux intel com>
Date:   Sat Feb 18 14:58:39 2012 +0000

    context: removes some uses of CoglHandle
    
    There were several members of the CoglContext struct using the
    CoglHandle type for things that now have replacement typedefs which
    this patch fixes.
    
    Reviewed-by: Neil Roberts <neil linux intel com>

 cogl/cogl-context-private.h |   17 ++++++++++-------
 cogl/cogl-pipeline-debug.c  |    4 ++--
 cogl/cogl-pipeline-opengl.c |    6 +++---
 cogl/cogl-pipeline.c        |    8 ++++----
 cogl/cogl-primitives.c      |    4 +++-
 5 files changed, 22 insertions(+), 17 deletions(-)
---
diff --git a/cogl/cogl-context-private.h b/cogl/cogl-context-private.h
index c9dd71f..522f5d4 100644
--- a/cogl/cogl-context-private.h
+++ b/cogl/cogl-context-private.h
@@ -43,6 +43,9 @@
 #include "cogl-atlas.h"
 #include "cogl-texture-driver.h"
 #include "cogl-pipeline-cache.h"
+#include "cogl-texture-2d.h"
+#include "cogl-texture-3d.h"
+#include "cogl-texture-rectangle.h"
 
 typedef struct
 {
@@ -67,10 +70,10 @@ struct _CoglContext
   CoglFeatureFlags feature_flags; /* legacy/deprecated feature flags */
   CoglPrivateFeatureFlags private_feature_flags;
 
-  CoglHandle        default_pipeline;
-  CoglHandle        default_layer_0;
-  CoglHandle        default_layer_n;
-  CoglHandle        dummy_layer_dependant;
+  CoglPipeline *default_pipeline;
+  CoglPipelineLayer *default_layer_0;
+  CoglPipelineLayer *default_layer_n;
+  CoglPipelineLayer *dummy_layer_dependant;
 
   GHashTable *attribute_name_states_hash;
   GArray *attribute_name_index_map;
@@ -125,9 +128,9 @@ struct _CoglContext
   CoglPipelineCache *pipeline_cache;
 
   /* Textures */
-  CoglHandle        default_gl_texture_2d_tex;
-  CoglHandle        default_gl_texture_3d_tex;
-  CoglHandle        default_gl_texture_rect_tex;
+  CoglTexture2D *default_gl_texture_2d_tex;
+  CoglTexture3D *default_gl_texture_3d_tex;
+  CoglTextureRectangle *default_gl_texture_rect_tex;
 
   /* Central list of all framebuffers so all journals can be flushed
    * at any time. */
diff --git a/cogl/cogl-pipeline-debug.c b/cogl/cogl-pipeline-debug.c
index 0dd7c6f..c9ca8e2 100644
--- a/cogl/cogl-pipeline-debug.c
+++ b/cogl/cogl-pipeline-debug.c
@@ -265,13 +265,13 @@ _cogl_debug_dump_pipelines_dot_file (const char *filename)
   layer_state.parent_id = -1;
   layer_state.node_id_ptr = &layer_id;
   layer_state.indent = 0;
-  dump_layer_cb (ctx->default_layer_0, &layer_state);
+  dump_layer_cb ((CoglNode *)ctx->default_layer_0, &layer_state);
 
   pipeline_state.graph = graph;
   pipeline_state.parent_id = -1;
   pipeline_state.node_id_ptr = &pipeline_id;
   pipeline_state.indent = 0;
-  dump_pipeline_cb (ctx->default_pipeline, &pipeline_state);
+  dump_pipeline_cb ((CoglNode *)ctx->default_pipeline, &pipeline_state);
 
   g_string_append_printf (graph, "}\n");
 
diff --git a/cogl/cogl-pipeline-opengl.c b/cogl/cogl-pipeline-opengl.c
index a00e34c..3237dc4 100644
--- a/cogl/cogl-pipeline-opengl.c
+++ b/cogl/cogl-pipeline-opengl.c
@@ -786,13 +786,13 @@ flush_layers_common_gl_state_cb (CoglPipelineLayer *layer, void *user_data)
         switch (_cogl_pipeline_layer_get_texture_type (layer))
           {
           case COGL_TEXTURE_TYPE_2D:
-            texture = ctx->default_gl_texture_2d_tex;
+            texture = COGL_TEXTURE (ctx->default_gl_texture_2d_tex);
             break;
           case COGL_TEXTURE_TYPE_3D:
-            texture = ctx->default_gl_texture_3d_tex;
+            texture = COGL_TEXTURE (ctx->default_gl_texture_3d_tex);
             break;
           case COGL_TEXTURE_TYPE_RECTANGLE:
-            texture = ctx->default_gl_texture_rect_tex;
+            texture = COGL_TEXTURE (ctx->default_gl_texture_rect_tex);
             break;
           }
 
diff --git a/cogl/cogl-pipeline.c b/cogl/cogl-pipeline.c
index 13a76bb..2d459f4 100644
--- a/cogl/cogl-pipeline.c
+++ b/cogl/cogl-pipeline.c
@@ -1889,15 +1889,15 @@ fallback_layer_cb (CoglPipelineLayer *layer, void *user_data)
   switch (texture_type)
     {
     case COGL_TEXTURE_TYPE_2D:
-      texture = ctx->default_gl_texture_2d_tex;
+      texture = COGL_TEXTURE (ctx->default_gl_texture_2d_tex);
       break;
 
     case COGL_TEXTURE_TYPE_3D:
-      texture = ctx->default_gl_texture_3d_tex;
+      texture = COGL_TEXTURE (ctx->default_gl_texture_3d_tex);
       break;
 
     case COGL_TEXTURE_TYPE_RECTANGLE:
-      texture = ctx->default_gl_texture_rect_tex;
+      texture = COGL_TEXTURE (ctx->default_gl_texture_rect_tex);
       break;
     }
 
@@ -1907,7 +1907,7 @@ fallback_layer_cb (CoglPipelineLayer *layer, void *user_data)
                  "in for an invalid pipeline layer, since it was "
                  "using an unsupported texture target ");
       /* might get away with this... */
-      texture = ctx->default_gl_texture_2d_tex;
+      texture = COGL_TEXTURE (ctx->default_gl_texture_2d_tex);
     }
 
   cogl_pipeline_set_layer_texture (pipeline, layer->index, texture);
diff --git a/cogl/cogl-primitives.c b/cogl/cogl-primitives.c
index 54479d7..1519c69 100644
--- a/cogl/cogl-primitives.c
+++ b/cogl/cogl-primitives.c
@@ -582,6 +582,7 @@ _cogl_rectangles_validate_layer_cb (CoglPipeline *pipeline,
       else
         {
           static gboolean warning_seen = FALSE;
+          CoglTexture2D *tex_2d;
 
           _COGL_GET_CONTEXT (ctx, FALSE);
 
@@ -592,8 +593,9 @@ _cogl_rectangles_validate_layer_cb (CoglPipeline *pipeline,
           warning_seen = TRUE;
 
           /* Note: currently only 2D textures can be sliced. */
+          tex_2d = ctx->default_gl_texture_2d_tex;
           cogl_pipeline_set_layer_texture (pipeline, layer_index,
-                                           ctx->default_gl_texture_2d_tex);
+                                           COGL_TEXTURE (tex_2d));
           return TRUE;
         }
     }



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