cogl: Port Primitive away from CoglObject

- The associated CoglAttribute's are now stored in GPtrArray as suggested
by carlosg in
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3193?commit_id=19b619073b3c7d311c64e0a997558f943b38c94a#note_1849281
- cogl_primitive_set_attributes was dropped for "simplicity"
especially that nothing uses it.
- As this is the last remaining CoglObject subclass, the commit also drops
all the CoglObject related macros/types

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3193>
This commit is contained in:
Bilal Elmoussaoui
2023-09-19 12:19:17 +02:00
committed by Marge Bot
parent b4bd69e4e8
commit 2c4968fb41
46 changed files with 99 additions and 1062 deletions

View File

@ -101,7 +101,7 @@ test_coglbox_fade_texture (CoglFramebuffer *framebuffer,
4,
vertices);
cogl_primitive_draw (primitive, framebuffer, pipeline);
cogl_object_unref (primitive);
g_object_unref (primitive);
}
static void
@ -144,7 +144,7 @@ test_coglbox_triangle_texture (CoglFramebuffer *framebuffer,
3,
vertices);
cogl_primitive_draw (primitive, framebuffer, pipeline);
cogl_object_unref (primitive);
g_object_unref (primitive);
}
static void

View File

@ -131,7 +131,7 @@ paint_test_backface_culling (TestState *state,
4,
verts);
cogl_primitive_draw (primitive, framebuffer, pipeline);
cogl_object_unref (primitive);
g_object_unref (primitive);
x1 = x2;
x2 = x1 + (float)(TEXTURE_RENDER_SIZE);
@ -151,7 +151,7 @@ paint_test_backface_culling (TestState *state,
4,
verts);
cogl_primitive_draw (primitive, framebuffer, pipeline);
cogl_object_unref (primitive);
g_object_unref (primitive);
x1 = x2;
x2 = x1 + (float)(TEXTURE_RENDER_SIZE);

View File

@ -68,7 +68,7 @@ test_float_verts (TestState *state, int offset_x, int offset_y)
attributes,
2); /* n_attributes */
cogl_primitive_draw (primitive, test_fb, state->pipeline);
cogl_object_unref (primitive);
g_object_unref (primitive);
cogl_framebuffer_pop_matrix (test_fb);
@ -129,7 +129,7 @@ test_byte_verts (TestState *state, int offset_x, int offset_y)
attributes,
2); /* n_attributes */
cogl_primitive_draw (primitive, test_fb, state->pipeline);
cogl_object_unref (primitive);
g_object_unref (primitive);
g_object_unref (attributes[1]);
@ -151,7 +151,7 @@ test_byte_verts (TestState *state, int offset_x, int offset_y)
attributes,
2); /* n_attributes */
cogl_primitive_draw (primitive, test_fb, state->pipeline);
cogl_object_unref (primitive);
g_object_unref (primitive);
cogl_framebuffer_pop_matrix (test_fb);
@ -213,7 +213,7 @@ test_short_verts (TestState *state, int offset_x, int offset_y)
attributes,
2); /* n_attributes */
cogl_primitive_draw (primitive, test_fb, pipeline);
cogl_object_unref (primitive);
g_object_unref (primitive);
cogl_framebuffer_pop_matrix (test_fb);
@ -248,7 +248,7 @@ test_short_verts (TestState *state, int offset_x, int offset_y)
attributes,
1); /* n_attributes */
cogl_primitive_draw (primitive, test_fb, pipeline2);
cogl_object_unref (primitive);
g_object_unref (primitive);
cogl_framebuffer_pop_matrix (test_fb);

View File

@ -108,7 +108,7 @@ test_map_buffer_range (void)
tex_coord_attribute,
NULL);
cogl_primitive_draw (primitive, test_fb, pipeline);
cogl_object_unref (primitive);
g_object_unref (primitive);
/* Top left pixel should be the one that is replaced to be green */
test_utils_check_pixel (test_fb, 1, 1, 0x00ff00ff);

View File

@ -125,7 +125,7 @@ do_test (const char *attribute_name,
pipeline_setup_func (pipeline);
cogl_primitive_draw (primitive, test_fb, pipeline);
g_object_unref (pipeline);
cogl_object_unref (primitive);
g_object_unref (primitive);
/* Verify all of the points where drawn at the right size */
for (i = 0; i < N_POINTS; i++)

View File

@ -82,7 +82,7 @@ test_point_size (void)
cogl_pipeline_set_color4ub (pipeline, 0, 255, 0, 255);
cogl_primitive_draw (prim, test_fb, pipeline);
cogl_object_unref (prim);
g_object_unref (prim);
g_object_unref (pipeline);
}

View File

@ -133,7 +133,7 @@ do_test (gboolean check_orientation,
cogl_primitive_draw (prim, test_fb, solid_pipeline);
cogl_framebuffer_pop_matrix (test_fb);
cogl_object_unref (prim);
g_object_unref (prim);
g_object_unref (solid_pipeline);
g_object_unref (pipeline);
g_object_unref (tex_2d);

View File

@ -133,7 +133,7 @@ do_test (gboolean check_orientation,
cogl_primitive_draw (prim, test_fb, solid_pipeline);
cogl_framebuffer_pop_matrix (test_fb);
cogl_object_unref (prim);
g_object_unref (prim);
g_object_unref (solid_pipeline);
g_object_unref (pipeline);
g_object_unref (tex_2d);

View File

@ -199,7 +199,7 @@ test_paint (TestState *state)
test_utils_check_pixel (test_fb, i * 10 + 2, 2, expected_color);
cogl_object_unref (prim);
g_object_unref (prim);
}
g_object_unref (pipeline);
@ -301,8 +301,8 @@ test_copy (TestState *state)
g_assert (cogl_primitive_get_indices (prim_a) ==
cogl_primitive_get_indices (prim_b));
cogl_object_unref (prim_a);
cogl_object_unref (prim_b);
g_object_unref (prim_a);
g_object_unref (prim_b);
g_object_unref (indices);
for (i = 0; i < N_ATTRIBS; i++)

View File

@ -129,7 +129,7 @@ draw_tests_polygon (TestState *state)
G_N_ELEMENTS (vertices),
vertices);
cogl_primitive_draw (primitive, test_fb, pipeline);
cogl_object_unref (primitive);
g_object_unref (primitive);
g_object_unref (pipeline);
cogl_framebuffer_pop_matrix (test_fb);
}