cogl: Move get_rectangle_indices to it correct namespace

Keep the implementation in cogl-indices.c though as it is too much of
implementation details to be in cogl-context.c.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4127>
This commit is contained in:
Bilal Elmoussaoui 2024-11-10 15:41:33 +01:00 committed by Marge Bot
parent 45296416df
commit c143e8e303
5 changed files with 14 additions and 11 deletions

View File

@ -356,7 +356,7 @@ emit_vertex_buffer_geometry (CoglFramebuffer *fb,
2 /* n_attributes */);
indices =
cogl_get_rectangle_indices (ctx, node->d.texture.rectangles->len);
cogl_context_get_rectangle_indices (ctx, node->d.texture.rectangles->len);
cogl_primitive_set_indices (prim, indices,
node->d.texture.rectangles->len * 6);

View File

@ -370,6 +370,15 @@ cogl_context_has_winsys_feature (CoglContext *context,
COGL_EXPORT void
cogl_context_flush (CoglContext *context);
/**
* cogl_context_get_rectangle_indices:
*
* Returns: (transfer none): a #CoglIndices
*/
COGL_EXPORT CoglIndices *
cogl_context_get_rectangle_indices (CoglContext *context,
int n_rectangles);
#ifdef HAVE_EGL
/**
* cogl_context_get_egl_display:

View File

@ -146,7 +146,8 @@ cogl_indices_get_offset (CoglIndices *indices)
}
CoglIndices *
cogl_get_rectangle_indices (CoglContext *ctx, int n_rectangles)
cogl_context_get_rectangle_indices (CoglContext *ctx,
int n_rectangles)
{
int n_indices = n_rectangles * 6;

View File

@ -98,7 +98,7 @@ G_BEGIN_DECLS
* needs to look like depending on the number of quads that need to be
* drawn. It doesn't matter how the quads might be animated and
* changed the indices will remain the same. Cogl even has a utility
* (cogl_get_rectangle_indices()) to get access to re-useable indices
* ([method@Cogl.Context.get_rectangle_indices]) to get access to re-useable indices
* for drawing quads as above.
*/
@ -133,12 +133,5 @@ cogl_indices_get_indices_type (CoglIndices *indices);
COGL_EXPORT size_t
cogl_indices_get_offset (CoglIndices *indices);
/**
* cogl_get_rectangle_indices:
*
* Returns: (transfer none): a #CoglIndices
*/
COGL_EXPORT CoglIndices *
cogl_get_rectangle_indices (CoglContext *context, int n_rectangles);
G_END_DECLS

View File

@ -628,7 +628,7 @@ _cogl_journal_flush_vbo_offsets_and_entries (CoglJournalEntry *batch_start,
4,
COGL_ATTRIBUTE_TYPE_UNSIGNED_BYTE);
state->indices = cogl_get_rectangle_indices (ctx, batch_len);
state->indices = cogl_context_get_rectangle_indices (ctx, batch_len);
/* We only create new Attributes when the stride within the
* AttributeBuffer changes. (due to a change in the number of pipeline