From 07689865fe3dbea4bbf013e2c7258e1a174f9596 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Sun, 18 Jan 2009 15:00:18 +0000 Subject: [PATCH] [tests] Update the tests calling cogl_texture_new_* The tests calling any of the cogl_texture_new_* family of functions must be updated to the new constructor syntax. --- tests/interactive/test-clip.c | 6 ++-- tests/interactive/test-cogl-offscreen.c | 6 ++-- tests/interactive/test-cogl-tex-convert.c | 12 ++++--- tests/interactive/test-cogl-tex-getset.c | 6 ++-- tests/interactive/test-cogl-tex-polygon.c | 38 ++++++++++++++++------- tests/interactive/test-cogl-tex-tile.c | 3 +- 6 files changed, 49 insertions(+), 22 deletions(-) diff --git a/tests/interactive/test-clip.c b/tests/interactive/test-clip.c index 5ccddfbcc..119b4ac68 100644 --- a/tests/interactive/test-clip.c +++ b/tests/interactive/test-clip.c @@ -302,8 +302,10 @@ test_clip_main (int argc, char **argv) stub_actor = clutter_rectangle_new (); clutter_container_add (CLUTTER_CONTAINER (data.stage), stub_actor, NULL); - data.hand = cogl_texture_new_from_file ("redhand.png", 64, FALSE, - COGL_PIXEL_FORMAT_ANY, NULL); + data.hand = cogl_texture_new_from_file ("redhand.png", 64, + COGL_TEXTURE_NONE, + COGL_PIXEL_FORMAT_ANY, + NULL); label = clutter_text_new_with_text ("Sans 12px", instructions); clutter_text_set_line_wrap (CLUTTER_TEXT (label), TRUE); diff --git a/tests/interactive/test-cogl-offscreen.c b/tests/interactive/test-cogl-offscreen.c index c18f73f33..893862e08 100644 --- a/tests/interactive/test-cogl-offscreen.c +++ b/tests/interactive/test-cogl-offscreen.c @@ -150,12 +150,14 @@ test_coglbox_init (TestCoglbox *self) self->priv = priv = TEST_COGLBOX_GET_PRIVATE(self); printf ("Loading redhand.png\n"); - priv->texhand_id = cogl_texture_new_from_file ("redhand.png", 0, FALSE, + priv->texhand_id = cogl_texture_new_from_file ("redhand.png", 0, + COGL_TEXTURE_NONE, COGL_PIXEL_FORMAT_ANY, NULL); printf ("Creating texture with size\n"); - priv->texture_id = cogl_texture_new_with_size (200,200,0, FALSE, + priv->texture_id = cogl_texture_new_with_size (200, 200, 0, + COGL_TEXTURE_NONE, COGL_PIXEL_FORMAT_RGB_888); if (priv->texture_id == COGL_INVALID_HANDLE) diff --git a/tests/interactive/test-cogl-tex-convert.c b/tests/interactive/test-cogl-tex-convert.c index d9dcb48fe..816ea403b 100644 --- a/tests/interactive/test-cogl-tex-convert.c +++ b/tests/interactive/test-cogl-tex-convert.c @@ -159,19 +159,23 @@ test_coglbox_init (TestCoglbox *self) self->priv = priv = TEST_COGLBOX_GET_PRIVATE(self); priv->cogl_tex_id[0] = - cogl_texture_new_from_file ("redhand.png", 0, FALSE, + cogl_texture_new_from_file ("redhand.png", 0, + COGL_TEXTURE_NONE, COGL_PIXEL_FORMAT_ANY, NULL); priv->cogl_tex_id[1] = - cogl_texture_new_from_file ("redhand.png", 0, FALSE, + cogl_texture_new_from_file ("redhand.png", 0, + COGL_TEXTURE_NONE, COGL_PIXEL_FORMAT_BGRA_8888, NULL); priv->cogl_tex_id[2] = - cogl_texture_new_from_file ("redhand.png", 0, FALSE, + cogl_texture_new_from_file ("redhand.png", 0, + COGL_TEXTURE_NONE, COGL_PIXEL_FORMAT_ARGB_8888, NULL); priv->cogl_tex_id[3] = - cogl_texture_new_from_file ("redhand.png", 0, FALSE, + cogl_texture_new_from_file ("redhand.png", 0, + COGL_TEXTURE_NONE, COGL_PIXEL_FORMAT_G_8, NULL); } diff --git a/tests/interactive/test-cogl-tex-getset.c b/tests/interactive/test-cogl-tex-getset.c index e562db7bf..056b5693d 100644 --- a/tests/interactive/test-cogl-tex-getset.c +++ b/tests/interactive/test-cogl-tex-getset.c @@ -141,7 +141,8 @@ test_coglbox_init (TestCoglbox *self) /* Load image from file */ priv->cogl_tex_id[0] = - cogl_texture_new_from_file ("redhand.png", 40, FALSE, + cogl_texture_new_from_file ("redhand.png", 40, + COGL_TEXTURE_NONE, COGL_PIXEL_FORMAT_ANY, NULL); if (priv->cogl_tex_id[0] == COGL_INVALID_HANDLE) @@ -176,7 +177,8 @@ test_coglbox_init (TestCoglbox *self) /* Create new texture from modified data */ priv->cogl_tex_id[1] = - cogl_texture_new_from_data (width, height, 0, FALSE, + cogl_texture_new_from_data (width, height, 0, + COGL_TEXTURE_NONE, format, format, rowstride, data); diff --git a/tests/interactive/test-cogl-tex-polygon.c b/tests/interactive/test-cogl-tex-polygon.c index 1e9d38b18..ae64998df 100644 --- a/tests/interactive/test-cogl-tex-polygon.c +++ b/tests/interactive/test-cogl-tex-polygon.c @@ -248,21 +248,37 @@ test_coglbox_init (TestCoglbox *self) priv->use_linear_filtering = FALSE; priv->use_sliced = FALSE; - priv->sliced_tex = cogl_texture_new_from_file - ("redhand.png", 10, FALSE, COGL_PIXEL_FORMAT_ANY, &error); - if (priv->sliced_tex == NULL) + priv->sliced_tex = + cogl_texture_new_from_file ("redhand.png", 10, + COGL_TEXTURE_NONE, + COGL_PIXEL_FORMAT_ANY, + &error); + if (priv->sliced_tex == COGL_INVALID_HANDLE) { - g_warning ("Texture loading failed: %s", error->message); - g_error_free (error); - error = NULL; + if (error) + { + g_warning ("Texture loading failed: %s", error->message); + g_error_free (error); + error = NULL; + } + else + g_warning ("Texture loading failed: "); } - priv->not_sliced_tex = cogl_texture_new_from_file - ("redhand.png", -1, FALSE, COGL_PIXEL_FORMAT_ANY, &error); - if (priv->not_sliced_tex == NULL) + priv->not_sliced_tex = + cogl_texture_new_from_file ("redhand.png", -1, + COGL_TEXTURE_NONE, + COGL_PIXEL_FORMAT_ANY, + &error); + if (priv->not_sliced_tex == COGL_INVALID_HANDLE) { - g_warning ("Texture loading failed: %s", error->message); - g_error_free (error); + if (error) + { + g_warning ("Texture loading failed: %s", error->message); + g_error_free (error); + } + else + g_warning ("Texture loading failed: "); } } diff --git a/tests/interactive/test-cogl-tex-tile.c b/tests/interactive/test-cogl-tex-tile.c index 177d60e65..8e2739a92 100644 --- a/tests/interactive/test-cogl-tex-tile.c +++ b/tests/interactive/test-cogl-tex-tile.c @@ -150,7 +150,8 @@ test_coglbox_init (TestCoglbox *self) TestCoglboxPrivate *priv; self->priv = priv = TEST_COGLBOX_GET_PRIVATE(self); - priv->cogl_tex_id = cogl_texture_new_from_file ("redhand.png", 0, FALSE, + priv->cogl_tex_id = cogl_texture_new_from_file ("redhand.png", 0, + COGL_TEXTURE_NONE, COGL_PIXEL_FORMAT_ANY, NULL);