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:
parent
45296416df
commit
c143e8e303
@ -356,7 +356,7 @@ emit_vertex_buffer_geometry (CoglFramebuffer *fb,
|
|||||||
2 /* n_attributes */);
|
2 /* n_attributes */);
|
||||||
|
|
||||||
indices =
|
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,
|
cogl_primitive_set_indices (prim, indices,
|
||||||
node->d.texture.rectangles->len * 6);
|
node->d.texture.rectangles->len * 6);
|
||||||
|
@ -370,6 +370,15 @@ cogl_context_has_winsys_feature (CoglContext *context,
|
|||||||
COGL_EXPORT void
|
COGL_EXPORT void
|
||||||
cogl_context_flush (CoglContext *context);
|
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
|
#ifdef HAVE_EGL
|
||||||
/**
|
/**
|
||||||
* cogl_context_get_egl_display:
|
* cogl_context_get_egl_display:
|
||||||
|
@ -146,7 +146,8 @@ cogl_indices_get_offset (CoglIndices *indices)
|
|||||||
}
|
}
|
||||||
|
|
||||||
CoglIndices *
|
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;
|
int n_indices = n_rectangles * 6;
|
||||||
|
|
||||||
|
@ -98,7 +98,7 @@ G_BEGIN_DECLS
|
|||||||
* needs to look like depending on the number of quads that need to be
|
* 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
|
* drawn. It doesn't matter how the quads might be animated and
|
||||||
* changed the indices will remain the same. Cogl even has a utility
|
* 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.
|
* for drawing quads as above.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -133,12 +133,5 @@ cogl_indices_get_indices_type (CoglIndices *indices);
|
|||||||
COGL_EXPORT size_t
|
COGL_EXPORT size_t
|
||||||
cogl_indices_get_offset (CoglIndices *indices);
|
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
|
G_END_DECLS
|
||||||
|
@ -628,7 +628,7 @@ _cogl_journal_flush_vbo_offsets_and_entries (CoglJournalEntry *batch_start,
|
|||||||
4,
|
4,
|
||||||
COGL_ATTRIBUTE_TYPE_UNSIGNED_BYTE);
|
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
|
/* We only create new Attributes when the stride within the
|
||||||
* AttributeBuffer changes. (due to a change in the number of pipeline
|
* AttributeBuffer changes. (due to a change in the number of pipeline
|
||||||
|
Loading…
x
Reference in New Issue
Block a user