tests/interactive: Port to cogl_texture_2d_new_from_data

Same old story.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2355>
This commit is contained in:
Georges Basile Stavracas Neto 2022-03-31 13:05:28 -03:00
parent 8ca20e709c
commit 0b47554f74

View File

@ -60,8 +60,9 @@ const char *
test_cogl_point_sprites_describe (void); test_cogl_point_sprites_describe (void);
static CoglTexture * static CoglTexture *
generate_round_texture (void) generate_round_texture (CoglContext *ctx)
{ {
g_autoptr (GError) error = NULL;
guint8 *p, *data; guint8 *p, *data;
int x, y; int x, y;
CoglTexture *tex; CoglTexture *tex;
@ -84,12 +85,14 @@ generate_round_texture (void)
*(p++) = value; *(p++) = value;
} }
tex = cogl_texture_new_from_data (TEXTURE_SIZE, TEXTURE_SIZE, tex = cogl_texture_2d_new_from_data (ctx,
COGL_TEXTURE_NO_SLICING, TEXTURE_SIZE, TEXTURE_SIZE,
COGL_PIXEL_FORMAT_RGBA_8888_PRE, COGL_PIXEL_FORMAT_RGBA_8888_PRE,
COGL_PIXEL_FORMAT_ANY, TEXTURE_SIZE * 4,
TEXTURE_SIZE * 4, data,
data); &error);
g_assert_no_error (error);
g_free (data); g_free (data);
@ -230,7 +233,7 @@ test_cogl_point_sprites_main (int argc, char *argv[])
data.next_spark_num = 0; data.next_spark_num = 0;
cogl_pipeline_set_point_size (data.pipeline, TEXTURE_SIZE); cogl_pipeline_set_point_size (data.pipeline, TEXTURE_SIZE);
tex = generate_round_texture (); tex = generate_round_texture (ctx);
cogl_pipeline_set_layer_texture (data.pipeline, 0, tex); cogl_pipeline_set_layer_texture (data.pipeline, 0, tex);
cogl_object_unref (tex); cogl_object_unref (tex);