From c143e8e303d0ce31f1252fa747333738ed16a345 Mon Sep 17 00:00:00 2001 From: Bilal Elmoussaoui Date: Sun, 10 Nov 2024 15:41:33 +0100 Subject: [PATCH] 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: --- clutter/clutter/pango/clutter-pango-display-list.c | 2 +- cogl/cogl/cogl-context.h | 9 +++++++++ cogl/cogl/cogl-indices.c | 3 ++- cogl/cogl/cogl-indices.h | 9 +-------- cogl/cogl/cogl-journal.c | 2 +- 5 files changed, 14 insertions(+), 11 deletions(-) diff --git a/clutter/clutter/pango/clutter-pango-display-list.c b/clutter/clutter/pango/clutter-pango-display-list.c index 8a4125961..ea5dd62b4 100644 --- a/clutter/clutter/pango/clutter-pango-display-list.c +++ b/clutter/clutter/pango/clutter-pango-display-list.c @@ -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); diff --git a/cogl/cogl/cogl-context.h b/cogl/cogl/cogl-context.h index 0a98700b8..70683ca50 100644 --- a/cogl/cogl/cogl-context.h +++ b/cogl/cogl/cogl-context.h @@ -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: diff --git a/cogl/cogl/cogl-indices.c b/cogl/cogl/cogl-indices.c index 78f759910..9d4ffa721 100644 --- a/cogl/cogl/cogl-indices.c +++ b/cogl/cogl/cogl-indices.c @@ -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; diff --git a/cogl/cogl/cogl-indices.h b/cogl/cogl/cogl-indices.h index 8a3650a8d..e9fdc916e 100644 --- a/cogl/cogl/cogl-indices.h +++ b/cogl/cogl/cogl-indices.h @@ -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 diff --git a/cogl/cogl/cogl-journal.c b/cogl/cogl/cogl-journal.c index 04021b346..943306a5b 100644 --- a/cogl/cogl/cogl-journal.c +++ b/cogl/cogl/cogl-journal.c @@ -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