diff --git a/src/tests/clutter/interactive/test-cogl-multitexture.c b/src/tests/clutter/interactive/test-cogl-multitexture.c index 5d825b766..c32f0516b 100644 --- a/src/tests/clutter/interactive/test-cogl-multitexture.c +++ b/src/tests/clutter/interactive/test-cogl-multitexture.c @@ -124,6 +124,7 @@ test_cogl_multitexture_main (int argc, char *argv[]) 0, 0, 1, 1, 0, 0, 1, 1 }; + CoglContext *ctx; clutter_test_init (&argc, &argv); @@ -150,35 +151,20 @@ test_cogl_multitexture_main (int argc, char *argv[]) files[2] = g_build_filename (TESTS_DATADIR, "light0.png", NULL); files[3] = NULL; - state->alpha_tex = - cogl_texture_new_from_file (files[0], - COGL_TEXTURE_NO_SLICING, - COGL_PIXEL_FORMAT_ANY, - &error); + ctx = clutter_backend_get_cogl_context (clutter_get_default_backend ()); + state->alpha_tex = cogl_texture_2d_new_from_file (ctx, files[0], &error); if (!state->alpha_tex) g_critical ("Failed to load redhand_alpha.png: %s", error->message); - state->redhand_tex = - cogl_texture_new_from_file (files[1], - COGL_TEXTURE_NO_SLICING, - COGL_PIXEL_FORMAT_ANY, - &error); + state->redhand_tex = cogl_texture_2d_new_from_file (ctx, files[1], &error); if (!state->redhand_tex) g_critical ("Failed to load redhand.png: %s", error->message); - state->light_tex0 = - cogl_texture_new_from_file (files[2], - COGL_TEXTURE_NO_SLICING, - COGL_PIXEL_FORMAT_ANY, - &error); + state->light_tex0 = cogl_texture_2d_new_from_file (ctx, files[2], &error); if (!state->light_tex0) g_critical ("Failed to load light0.png: %s", error->message); - state->light_tex1 = - cogl_texture_new_from_file (files[2], - COGL_TEXTURE_NO_SLICING, - COGL_PIXEL_FORMAT_ANY, - &error); + state->light_tex1 = cogl_texture_2d_new_from_file (ctx, files[2], &error); if (!state->light_tex1) g_critical ("Failed to load light0.png: %s", error->message); diff --git a/src/tests/clutter/interactive/test-cogl-offscreen.c b/src/tests/clutter/interactive/test-cogl-offscreen.c index 967a23b36..3cd366da6 100644 --- a/src/tests/clutter/interactive/test-cogl-offscreen.c +++ b/src/tests/clutter/interactive/test-cogl-offscreen.c @@ -226,16 +226,16 @@ test_coglbox_map (ClutterActor *actor) static void test_coglbox_init (TestCoglbox *self) { + g_autoptr (GError) error = NULL; CoglContext *ctx = clutter_backend_get_cogl_context (clutter_get_default_backend ()); gchar *file; printf ("Loading redhand.png\n"); file = g_build_filename (TESTS_DATADIR, "redhand.png", NULL); - self->texhand_id = cogl_texture_new_from_file (file, - COGL_TEXTURE_NONE, - COGL_PIXEL_FORMAT_ANY, - NULL); + self->texhand_id = cogl_texture_2d_new_from_file (ctx, file, &error); + if (error) + g_warning ("Error loading redhand.png: %s", error->message); g_free (file); printf ("Creating texture with size\n"); diff --git a/src/tests/clutter/interactive/test-cogl-shader-glsl.c b/src/tests/clutter/interactive/test-cogl-shader-glsl.c index 67bc16948..e4ca1e360 100644 --- a/src/tests/clutter/interactive/test-cogl-shader-glsl.c +++ b/src/tests/clutter/interactive/test-cogl-shader-glsl.c @@ -323,10 +323,7 @@ test_cogl_shader_glsl_main (int argc, char *argv[]) file = g_build_filename (TESTS_DATADIR, "redhand.png", NULL); error = NULL; - redhand = cogl_texture_new_from_file (file, - COGL_TEXTURE_NO_ATLAS, - COGL_PIXEL_FORMAT_ANY, - &error); + redhand = cogl_texture_2d_new_from_file (ctx, file, &error); if (redhand == NULL) g_error ("image load failed: %s", error->message); diff --git a/src/tests/clutter/interactive/test-cogl-tex-polygon.c b/src/tests/clutter/interactive/test-cogl-tex-polygon.c index 65f7c3763..86e72086d 100644 --- a/src/tests/clutter/interactive/test-cogl-tex-polygon.c +++ b/src/tests/clutter/interactive/test-cogl-tex-polygon.c @@ -227,6 +227,8 @@ test_coglbox_dispose (GObject *object) static void test_coglbox_init (TestCoglbox *self) { + CoglContext *ctx = + clutter_backend_get_cogl_context (clutter_get_default_backend ()); GError *error = NULL; gchar *file; @@ -235,10 +237,9 @@ test_coglbox_init (TestCoglbox *self) file = g_build_filename (TESTS_DATADIR, "redhand.png", NULL); self->sliced_tex = - cogl_texture_new_from_file (file, - COGL_TEXTURE_NONE, - COGL_PIXEL_FORMAT_ANY, - &error); + cogl_texture_2d_sliced_new_from_file (ctx, file, + COGL_TEXTURE_MAX_WASTE, + &error); if (self->sliced_tex == NULL) { if (error) @@ -251,11 +252,7 @@ test_coglbox_init (TestCoglbox *self) g_warning ("Texture loading failed: "); } - self->not_sliced_tex = - cogl_texture_new_from_file (file, - COGL_TEXTURE_NO_SLICING, - COGL_PIXEL_FORMAT_ANY, - &error); + self->not_sliced_tex = cogl_texture_2d_new_from_file (ctx, file, &error); if (self->not_sliced_tex == NULL) { if (error) diff --git a/src/tests/clutter/interactive/test-cogl-tex-tile.c b/src/tests/clutter/interactive/test-cogl-tex-tile.c index bbd5b7ed4..b79fd5b67 100644 --- a/src/tests/clutter/interactive/test-cogl-tex-tile.c +++ b/src/tests/clutter/interactive/test-cogl-tex-tile.c @@ -100,13 +100,15 @@ test_coglbox_dispose (GObject *object) static void test_coglbox_init (TestCoglbox *self) { + g_autoptr (GError) error = NULL; + CoglContext *ctx = + clutter_backend_get_cogl_context (clutter_get_default_backend ()); gchar *file; file = g_build_filename (TESTS_DATADIR, "redhand.png", NULL); - self->cogl_tex_id = cogl_texture_new_from_file (file, - COGL_TEXTURE_NONE, - COGL_PIXEL_FORMAT_ANY, - NULL); + self->cogl_tex_id = cogl_texture_2d_new_from_file (ctx, file, &error); + if (error) + g_warning ("Error loading redhand.png: %s", error->message); g_free (file); }