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);
enable_flags =
_cogl_material_get_cogl_enable_flags (_context->source_material);
cogl_enable (enable_flags);
_cogl_enable (enable_flags);
_cogl_flush_face_winding ();
_context->atlas = NULL;

View File

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

View File

@ -263,7 +263,7 @@ _cogl_journal_flush_modelview_and_entries (CoglJournalEntry *batch_start,
color_intensity : 0,
0xff);
_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++)
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);
/* 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);
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_COLOR_ARRAY;
cogl_enable (enable_flags);
_cogl_enable (enable_flags);
_cogl_flush_face_winding ();
/* 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);
}
/* 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. */
unsigned long
_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);
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;
/* disable all texture layers */
@ -171,7 +171,7 @@ _cogl_add_path_to_stencil_buffer (floatVec2 nodes_min,
enable_flags |=
_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,
&bounds_x, &bounds_y, &bounds_w, &bounds_h);
@ -207,7 +207,7 @@ _cogl_add_path_to_stencil_buffer (floatVec2 nodes_min,
* enable flags */
_cogl_matrix_stack_flush_to_gl (modelview_stack,
COGL_MATRIX_MODELVIEW);
cogl_enable (enable_flags);
_cogl_enable (enable_flags);
}
GE (glStencilMask (1));
GE (glStencilFunc (GL_LEQUAL, 0x1, 0x3));
@ -244,7 +244,7 @@ _cogl_add_path_to_stencil_buffer (floatVec2 nodes_min,
* enable flags */
_cogl_matrix_stack_flush_to_gl (modelview_stack,
COGL_MATRIX_MODELVIEW);
cogl_enable (enable_flags);
_cogl_enable (enable_flags);
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_enable (COGL_ENABLE_VERTEX_ARRAY
_cogl_enable (COGL_ENABLE_VERTEX_ARRAY
| (ctx->color_alpha < 255 ? COGL_ENABLE_BLEND : 0));
/* clear scanline intersection lists */

View File

@ -969,7 +969,7 @@ cogl_polygon (const CoglTextureVertex *vertices,
v + 3 + 2 * n_layers) );
}
cogl_enable (enable_flags);
_cogl_enable (enable_flags);
_cogl_flush_face_winding ();
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)
enable_flags |= COGL_ENABLE_BACKFACE_CULLING;
cogl_enable (enable_flags);
_cogl_enable (enable_flags);
_cogl_flush_face_winding ();
}

View File

@ -204,11 +204,11 @@ cogl_clear (const CoglColor *color, unsigned long buffers)
COGL_NOTE (DRAW, "Clear end");
}
static inline gboolean
cogl_toggle_flag (CoglContext *ctx,
unsigned long new_flags,
unsigned long flag,
GLenum gl_flag)
static gboolean
toggle_flag (CoglContext *ctx,
unsigned long new_flags,
unsigned long flag,
GLenum gl_flag)
{
/* Toggles and caches a single enable flag on or off
* by comparing to current state
@ -231,11 +231,11 @@ cogl_toggle_flag (CoglContext *ctx,
return FALSE;
}
static inline gboolean
cogl_toggle_client_flag (CoglContext *ctx,
unsigned long new_flags,
unsigned long flag,
GLenum gl_flag)
static gboolean
toggle_client_flag (CoglContext *ctx,
unsigned long new_flags,
unsigned long flag,
GLenum gl_flag)
{
/* Toggles and caches a single client-side enable flag
* on or off by comparing to current state
@ -259,32 +259,32 @@ cogl_toggle_client_flag (CoglContext *ctx,
}
void
cogl_enable (unsigned long flags)
_cogl_enable (unsigned long flags)
{
/* This function essentially caches glEnable state() in the
* hope of lessening number GL traffic.
*/
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
cogl_toggle_flag (ctx, flags,
COGL_ENABLE_BLEND,
GL_BLEND);
toggle_flag (ctx, flags,
COGL_ENABLE_BLEND,
GL_BLEND);
cogl_toggle_flag (ctx, flags,
COGL_ENABLE_BACKFACE_CULLING,
GL_CULL_FACE);
toggle_flag (ctx, flags,
COGL_ENABLE_BACKFACE_CULLING,
GL_CULL_FACE);
cogl_toggle_client_flag (ctx, flags,
COGL_ENABLE_VERTEX_ARRAY,
GL_VERTEX_ARRAY);
toggle_client_flag (ctx, flags,
COGL_ENABLE_VERTEX_ARRAY,
GL_VERTEX_ARRAY);
cogl_toggle_client_flag (ctx, flags,
COGL_ENABLE_COLOR_ARRAY,
GL_COLOR_ARRAY);
toggle_client_flag (ctx, flags,
COGL_ENABLE_COLOR_ARRAY,
GL_COLOR_ARRAY);
}
unsigned long
cogl_get_enable ()
_cogl_get_enable (void)
{
_COGL_GET_CONTEXT (ctx, 0);
@ -767,13 +767,13 @@ cogl_begin_gl (void)
_cogl_material_flush_gl_state (ctx->source_material, &options);
/* 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);
if (ctx->enable_backface_culling)
enable_flags |= COGL_ENABLE_BACKFACE_CULLING;
cogl_enable (enable_flags);
_cogl_enable (enable_flags);
_cogl_flush_face_winding ();
/* Disable all client texture coordinate arrays */