cogl: rename cogl_enable to _cogl_enable

Every now and then someone sees the cogl_enable API and gets confused,
thinking its public API so this renames the symbol to be clear that it's
is an internal only API.
This commit is contained in:
Robert Bragg 2010-03-19 09:16:08 +00:00
parent fdf608af4c
commit 1dd70aff73
8 changed files with 40 additions and 40 deletions

View File

@ -144,7 +144,7 @@ cogl_create_context (void)
_cogl_material_flush_gl_state (_context->source_material, NULL); _cogl_material_flush_gl_state (_context->source_material, NULL);
enable_flags = enable_flags =
_cogl_material_get_cogl_enable_flags (_context->source_material); _cogl_material_get_cogl_enable_flags (_context->source_material);
cogl_enable (enable_flags); _cogl_enable (enable_flags);
_cogl_flush_face_winding (); _cogl_flush_face_winding ();
_context->atlas = NULL; _context->atlas = NULL;

View File

@ -133,10 +133,10 @@ int
_cogl_get_format_bpp (CoglPixelFormat format); _cogl_get_format_bpp (CoglPixelFormat format);
void void
cogl_enable (gulong flags); _cogl_enable (unsigned long flags);
unsigned long unsigned long
cogl_get_enable (void); _cogl_get_enable (void);
typedef struct _CoglTextureUnit typedef struct _CoglTextureUnit
{ {

View File

@ -263,7 +263,7 @@ _cogl_journal_flush_modelview_and_entries (CoglJournalEntry *batch_start,
color_intensity : 0, color_intensity : 0,
0xff); 0xff);
_cogl_material_flush_gl_state (outline, NULL); _cogl_material_flush_gl_state (outline, NULL);
cogl_enable (COGL_ENABLE_VERTEX_ARRAY); _cogl_enable (COGL_ENABLE_VERTEX_ARRAY);
for (i = 0; i < batch_len; i++) for (i = 0; i < batch_len; i++)
GE( glDrawArrays (GL_LINE_LOOP, 4 * i + state->vertex_offset, 4) ); GE( glDrawArrays (GL_LINE_LOOP, 4 * i + state->vertex_offset, 4) );
@ -319,7 +319,7 @@ _cogl_journal_flush_material_and_entries (CoglJournalEntry *batch_start,
&batch_start->flush_options); &batch_start->flush_options);
/* FIXME: This api is a bit yukky, ideally it will be removed if we /* FIXME: This api is a bit yukky, ideally it will be removed if we
* re-work the cogl_enable mechanism */ * re-work the _cogl_enable mechanism */
enable_flags |= _cogl_material_get_cogl_enable_flags (batch_start->material); enable_flags |= _cogl_material_get_cogl_enable_flags (batch_start->material);
if (ctx->enable_backface_culling) if (ctx->enable_backface_culling)
@ -327,7 +327,7 @@ _cogl_journal_flush_material_and_entries (CoglJournalEntry *batch_start,
enable_flags |= COGL_ENABLE_VERTEX_ARRAY; enable_flags |= COGL_ENABLE_VERTEX_ARRAY;
enable_flags |= COGL_ENABLE_COLOR_ARRAY; enable_flags |= COGL_ENABLE_COLOR_ARRAY;
cogl_enable (enable_flags); _cogl_enable (enable_flags);
_cogl_flush_face_winding (); _cogl_flush_face_winding ();
/* If we haven't transformed the quads in software then we need to also break /* If we haven't transformed the quads in software then we need to also break

View File

@ -1098,7 +1098,7 @@ cogl_material_remove_layer (CoglHandle material_handle,
handle_automatic_blend_enable (material); handle_automatic_blend_enable (material);
} }
/* XXX: This API is hopfully just a stop-gap solution. Ideally cogl_enable /* XXX: This API is hopfully just a stop-gap solution. Ideally _cogl_enable
* will be replaced. */ * will be replaced. */
unsigned long unsigned long
_cogl_material_get_cogl_enable_flags (CoglHandle material_handle) _cogl_material_get_cogl_enable_flags (CoglHandle material_handle)

View File

@ -92,7 +92,7 @@ _cogl_path_stroke_nodes (void)
_cogl_framebuffer_flush_state (_cogl_get_framebuffer (), 0); _cogl_framebuffer_flush_state (_cogl_get_framebuffer (), 0);
enable_flags |= _cogl_material_get_cogl_enable_flags (ctx->source_material); enable_flags |= _cogl_material_get_cogl_enable_flags (ctx->source_material);
cogl_enable (enable_flags); _cogl_enable (enable_flags);
options.flags = COGL_MATERIAL_FLUSH_DISABLE_MASK; options.flags = COGL_MATERIAL_FLUSH_DISABLE_MASK;
/* disable all texture layers */ /* disable all texture layers */
@ -171,7 +171,7 @@ _cogl_add_path_to_stencil_buffer (floatVec2 nodes_min,
enable_flags |= enable_flags |=
_cogl_material_get_cogl_enable_flags (ctx->source_material); _cogl_material_get_cogl_enable_flags (ctx->source_material);
cogl_enable (enable_flags); _cogl_enable (enable_flags);
_cogl_path_get_bounds (nodes_min, nodes_max, _cogl_path_get_bounds (nodes_min, nodes_max,
&bounds_x, &bounds_y, &bounds_w, &bounds_h); &bounds_x, &bounds_y, &bounds_w, &bounds_h);
@ -207,7 +207,7 @@ _cogl_add_path_to_stencil_buffer (floatVec2 nodes_min,
* enable flags */ * enable flags */
_cogl_matrix_stack_flush_to_gl (modelview_stack, _cogl_matrix_stack_flush_to_gl (modelview_stack,
COGL_MATRIX_MODELVIEW); COGL_MATRIX_MODELVIEW);
cogl_enable (enable_flags); _cogl_enable (enable_flags);
} }
GE (glStencilMask (1)); GE (glStencilMask (1));
GE (glStencilFunc (GL_LEQUAL, 0x1, 0x3)); GE (glStencilFunc (GL_LEQUAL, 0x1, 0x3));
@ -244,7 +244,7 @@ _cogl_add_path_to_stencil_buffer (floatVec2 nodes_min,
* enable flags */ * enable flags */
_cogl_matrix_stack_flush_to_gl (modelview_stack, _cogl_matrix_stack_flush_to_gl (modelview_stack,
COGL_MATRIX_MODELVIEW); COGL_MATRIX_MODELVIEW);
cogl_enable (enable_flags); _cogl_enable (enable_flags);
GE (glStencilOp (GL_INVERT, GL_INVERT, GL_INVERT)); GE (glStencilOp (GL_INVERT, GL_INVERT, GL_INVERT));
} }
@ -342,7 +342,7 @@ _cogl_path_fill_nodes_scanlines (CoglPathNode *path,
_cogl_material_flush_gl_state (ctx->source_material, NULL); _cogl_material_flush_gl_state (ctx->source_material, NULL);
cogl_enable (COGL_ENABLE_VERTEX_ARRAY _cogl_enable (COGL_ENABLE_VERTEX_ARRAY
| (ctx->color_alpha < 255 ? COGL_ENABLE_BLEND : 0)); | (ctx->color_alpha < 255 ? COGL_ENABLE_BLEND : 0));
/* clear scanline intersection lists */ /* clear scanline intersection lists */

View File

@ -969,7 +969,7 @@ cogl_polygon (const CoglTextureVertex *vertices,
v + 3 + 2 * n_layers) ); v + 3 + 2 * n_layers) );
} }
cogl_enable (enable_flags); _cogl_enable (enable_flags);
_cogl_flush_face_winding (); _cogl_flush_face_winding ();
GE (glVertexPointer (3, GL_FLOAT, stride_bytes, v)); GE (glVertexPointer (3, GL_FLOAT, stride_bytes, v));

View File

@ -1694,7 +1694,7 @@ enable_state_for_drawing_buffer (CoglVertexBuffer *buffer)
if (ctx->enable_backface_culling) if (ctx->enable_backface_culling)
enable_flags |= COGL_ENABLE_BACKFACE_CULLING; enable_flags |= COGL_ENABLE_BACKFACE_CULLING;
cogl_enable (enable_flags); _cogl_enable (enable_flags);
_cogl_flush_face_winding (); _cogl_flush_face_winding ();
} }

View File

@ -204,8 +204,8 @@ cogl_clear (const CoglColor *color, unsigned long buffers)
COGL_NOTE (DRAW, "Clear end"); COGL_NOTE (DRAW, "Clear end");
} }
static inline gboolean static gboolean
cogl_toggle_flag (CoglContext *ctx, toggle_flag (CoglContext *ctx,
unsigned long new_flags, unsigned long new_flags,
unsigned long flag, unsigned long flag,
GLenum gl_flag) GLenum gl_flag)
@ -231,8 +231,8 @@ cogl_toggle_flag (CoglContext *ctx,
return FALSE; return FALSE;
} }
static inline gboolean static gboolean
cogl_toggle_client_flag (CoglContext *ctx, toggle_client_flag (CoglContext *ctx,
unsigned long new_flags, unsigned long new_flags,
unsigned long flag, unsigned long flag,
GLenum gl_flag) GLenum gl_flag)
@ -259,32 +259,32 @@ cogl_toggle_client_flag (CoglContext *ctx,
} }
void void
cogl_enable (unsigned long flags) _cogl_enable (unsigned long flags)
{ {
/* This function essentially caches glEnable state() in the /* This function essentially caches glEnable state() in the
* hope of lessening number GL traffic. * hope of lessening number GL traffic.
*/ */
_COGL_GET_CONTEXT (ctx, NO_RETVAL); _COGL_GET_CONTEXT (ctx, NO_RETVAL);
cogl_toggle_flag (ctx, flags, toggle_flag (ctx, flags,
COGL_ENABLE_BLEND, COGL_ENABLE_BLEND,
GL_BLEND); GL_BLEND);
cogl_toggle_flag (ctx, flags, toggle_flag (ctx, flags,
COGL_ENABLE_BACKFACE_CULLING, COGL_ENABLE_BACKFACE_CULLING,
GL_CULL_FACE); GL_CULL_FACE);
cogl_toggle_client_flag (ctx, flags, toggle_client_flag (ctx, flags,
COGL_ENABLE_VERTEX_ARRAY, COGL_ENABLE_VERTEX_ARRAY,
GL_VERTEX_ARRAY); GL_VERTEX_ARRAY);
cogl_toggle_client_flag (ctx, flags, toggle_client_flag (ctx, flags,
COGL_ENABLE_COLOR_ARRAY, COGL_ENABLE_COLOR_ARRAY,
GL_COLOR_ARRAY); GL_COLOR_ARRAY);
} }
unsigned long unsigned long
cogl_get_enable () _cogl_get_enable (void)
{ {
_COGL_GET_CONTEXT (ctx, 0); _COGL_GET_CONTEXT (ctx, 0);
@ -767,13 +767,13 @@ cogl_begin_gl (void)
_cogl_material_flush_gl_state (ctx->source_material, &options); _cogl_material_flush_gl_state (ctx->source_material, &options);
/* FIXME: This api is a bit yukky, ideally it will be removed if we /* FIXME: This api is a bit yukky, ideally it will be removed if we
* re-work the cogl_enable mechanism */ * re-work the _cogl_enable mechanism */
enable_flags |= _cogl_material_get_cogl_enable_flags (ctx->source_material); enable_flags |= _cogl_material_get_cogl_enable_flags (ctx->source_material);
if (ctx->enable_backface_culling) if (ctx->enable_backface_culling)
enable_flags |= COGL_ENABLE_BACKFACE_CULLING; enable_flags |= COGL_ENABLE_BACKFACE_CULLING;
cogl_enable (enable_flags); _cogl_enable (enable_flags);
_cogl_flush_face_winding (); _cogl_flush_face_winding ();
/* Disable all client texture coordinate arrays */ /* Disable all client texture coordinate arrays */