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>
This commit is contained in:
Robert Bragg 2012-02-18 14:58:39 +00:00
parent 47868e1f3e
commit 0a2a3d7c80
5 changed files with 22 additions and 17 deletions

View File

@ -43,6 +43,9 @@
#include "cogl-atlas.h" #include "cogl-atlas.h"
#include "cogl-texture-driver.h" #include "cogl-texture-driver.h"
#include "cogl-pipeline-cache.h" #include "cogl-pipeline-cache.h"
#include "cogl-texture-2d.h"
#include "cogl-texture-3d.h"
#include "cogl-texture-rectangle.h"
typedef struct typedef struct
{ {
@ -67,10 +70,10 @@ struct _CoglContext
CoglFeatureFlags feature_flags; /* legacy/deprecated feature flags */ CoglFeatureFlags feature_flags; /* legacy/deprecated feature flags */
CoglPrivateFeatureFlags private_feature_flags; CoglPrivateFeatureFlags private_feature_flags;
CoglHandle default_pipeline; CoglPipeline *default_pipeline;
CoglHandle default_layer_0; CoglPipelineLayer *default_layer_0;
CoglHandle default_layer_n; CoglPipelineLayer *default_layer_n;
CoglHandle dummy_layer_dependant; CoglPipelineLayer *dummy_layer_dependant;
GHashTable *attribute_name_states_hash; GHashTable *attribute_name_states_hash;
GArray *attribute_name_index_map; GArray *attribute_name_index_map;
@ -125,9 +128,9 @@ struct _CoglContext
CoglPipelineCache *pipeline_cache; CoglPipelineCache *pipeline_cache;
/* Textures */ /* Textures */
CoglHandle default_gl_texture_2d_tex; CoglTexture2D *default_gl_texture_2d_tex;
CoglHandle default_gl_texture_3d_tex; CoglTexture3D *default_gl_texture_3d_tex;
CoglHandle default_gl_texture_rect_tex; CoglTextureRectangle *default_gl_texture_rect_tex;
/* Central list of all framebuffers so all journals can be flushed /* Central list of all framebuffers so all journals can be flushed
* at any time. */ * at any time. */

View File

@ -265,13 +265,13 @@ _cogl_debug_dump_pipelines_dot_file (const char *filename)
layer_state.parent_id = -1; layer_state.parent_id = -1;
layer_state.node_id_ptr = &layer_id; layer_state.node_id_ptr = &layer_id;
layer_state.indent = 0; 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.graph = graph;
pipeline_state.parent_id = -1; pipeline_state.parent_id = -1;
pipeline_state.node_id_ptr = &pipeline_id; pipeline_state.node_id_ptr = &pipeline_id;
pipeline_state.indent = 0; 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"); g_string_append_printf (graph, "}\n");

View File

@ -786,13 +786,13 @@ flush_layers_common_gl_state_cb (CoglPipelineLayer *layer, void *user_data)
switch (_cogl_pipeline_layer_get_texture_type (layer)) switch (_cogl_pipeline_layer_get_texture_type (layer))
{ {
case COGL_TEXTURE_TYPE_2D: case COGL_TEXTURE_TYPE_2D:
texture = ctx->default_gl_texture_2d_tex; texture = COGL_TEXTURE (ctx->default_gl_texture_2d_tex);
break; break;
case COGL_TEXTURE_TYPE_3D: case COGL_TEXTURE_TYPE_3D:
texture = ctx->default_gl_texture_3d_tex; texture = COGL_TEXTURE (ctx->default_gl_texture_3d_tex);
break; break;
case COGL_TEXTURE_TYPE_RECTANGLE: case COGL_TEXTURE_TYPE_RECTANGLE:
texture = ctx->default_gl_texture_rect_tex; texture = COGL_TEXTURE (ctx->default_gl_texture_rect_tex);
break; break;
} }

View File

@ -1889,15 +1889,15 @@ fallback_layer_cb (CoglPipelineLayer *layer, void *user_data)
switch (texture_type) switch (texture_type)
{ {
case COGL_TEXTURE_TYPE_2D: case COGL_TEXTURE_TYPE_2D:
texture = ctx->default_gl_texture_2d_tex; texture = COGL_TEXTURE (ctx->default_gl_texture_2d_tex);
break; break;
case COGL_TEXTURE_TYPE_3D: case COGL_TEXTURE_TYPE_3D:
texture = ctx->default_gl_texture_3d_tex; texture = COGL_TEXTURE (ctx->default_gl_texture_3d_tex);
break; break;
case COGL_TEXTURE_TYPE_RECTANGLE: case COGL_TEXTURE_TYPE_RECTANGLE:
texture = ctx->default_gl_texture_rect_tex; texture = COGL_TEXTURE (ctx->default_gl_texture_rect_tex);
break; break;
} }
@ -1907,7 +1907,7 @@ fallback_layer_cb (CoglPipelineLayer *layer, void *user_data)
"in for an invalid pipeline layer, since it was " "in for an invalid pipeline layer, since it was "
"using an unsupported texture target "); "using an unsupported texture target ");
/* might get away with this... */ /* 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); cogl_pipeline_set_layer_texture (pipeline, layer->index, texture);

View File

@ -582,6 +582,7 @@ _cogl_rectangles_validate_layer_cb (CoglPipeline *pipeline,
else else
{ {
static gboolean warning_seen = FALSE; static gboolean warning_seen = FALSE;
CoglTexture2D *tex_2d;
_COGL_GET_CONTEXT (ctx, FALSE); _COGL_GET_CONTEXT (ctx, FALSE);
@ -592,8 +593,9 @@ _cogl_rectangles_validate_layer_cb (CoglPipeline *pipeline,
warning_seen = TRUE; warning_seen = TRUE;
/* Note: currently only 2D textures can be sliced. */ /* Note: currently only 2D textures can be sliced. */
tex_2d = ctx->default_gl_texture_2d_tex;
cogl_pipeline_set_layer_texture (pipeline, layer_index, cogl_pipeline_set_layer_texture (pipeline, layer_index,
ctx->default_gl_texture_2d_tex); COGL_TEXTURE (tex_2d));
return TRUE; return TRUE;
} }
} }