From 1dd70aff731ae8eba747d0dc914021067b1adadc Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Fri, 19 Mar 2010 09:16:08 +0000 Subject: [PATCH] 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. --- clutter/cogl/cogl/cogl-context.c | 2 +- clutter/cogl/cogl/cogl-internal.h | 4 +- clutter/cogl/cogl/cogl-journal.c | 6 +-- clutter/cogl/cogl/cogl-material.c | 2 +- clutter/cogl/cogl/cogl-path.c | 10 ++--- clutter/cogl/cogl/cogl-primitives.c | 2 +- clutter/cogl/cogl/cogl-vertex-buffer.c | 2 +- clutter/cogl/cogl/cogl.c | 52 +++++++++++++------------- 8 files changed, 40 insertions(+), 40 deletions(-) diff --git a/clutter/cogl/cogl/cogl-context.c b/clutter/cogl/cogl/cogl-context.c index 596fb2517..72601c758 100644 --- a/clutter/cogl/cogl/cogl-context.c +++ b/clutter/cogl/cogl/cogl-context.c @@ -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; diff --git a/clutter/cogl/cogl/cogl-internal.h b/clutter/cogl/cogl/cogl-internal.h index 2a6e49a95..3cf7c17b6 100644 --- a/clutter/cogl/cogl/cogl-internal.h +++ b/clutter/cogl/cogl/cogl-internal.h @@ -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 { diff --git a/clutter/cogl/cogl/cogl-journal.c b/clutter/cogl/cogl/cogl-journal.c index b5f0a7241..87db61885 100644 --- a/clutter/cogl/cogl/cogl-journal.c +++ b/clutter/cogl/cogl/cogl-journal.c @@ -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 diff --git a/clutter/cogl/cogl/cogl-material.c b/clutter/cogl/cogl/cogl-material.c index 57ab82fd5..576ca063e 100644 --- a/clutter/cogl/cogl/cogl-material.c +++ b/clutter/cogl/cogl/cogl-material.c @@ -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) diff --git a/clutter/cogl/cogl/cogl-path.c b/clutter/cogl/cogl/cogl-path.c index 5f0cc2aed..1255a18e5 100644 --- a/clutter/cogl/cogl/cogl-path.c +++ b/clutter/cogl/cogl/cogl-path.c @@ -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 */ diff --git a/clutter/cogl/cogl/cogl-primitives.c b/clutter/cogl/cogl/cogl-primitives.c index 471a65f2f..bf31dc13d 100644 --- a/clutter/cogl/cogl/cogl-primitives.c +++ b/clutter/cogl/cogl/cogl-primitives.c @@ -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)); diff --git a/clutter/cogl/cogl/cogl-vertex-buffer.c b/clutter/cogl/cogl/cogl-vertex-buffer.c index 56ade6a3d..aafd96e22 100644 --- a/clutter/cogl/cogl/cogl-vertex-buffer.c +++ b/clutter/cogl/cogl/cogl-vertex-buffer.c @@ -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 (); } diff --git a/clutter/cogl/cogl/cogl.c b/clutter/cogl/cogl/cogl.c index af30f2f43..106c229c9 100644 --- a/clutter/cogl/cogl/cogl.c +++ b/clutter/cogl/cogl/cogl.c @@ -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 */