mirror of
https://github.com/brl/mutter.git
synced 2025-02-12 19:34:10 +00:00
[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.
This commit is contained in:
parent
c9739e6aef
commit
07689865fe
@ -302,8 +302,10 @@ test_clip_main (int argc, char **argv)
|
|||||||
stub_actor = clutter_rectangle_new ();
|
stub_actor = clutter_rectangle_new ();
|
||||||
clutter_container_add (CLUTTER_CONTAINER (data.stage), stub_actor, NULL);
|
clutter_container_add (CLUTTER_CONTAINER (data.stage), stub_actor, NULL);
|
||||||
|
|
||||||
data.hand = cogl_texture_new_from_file ("redhand.png", 64, FALSE,
|
data.hand = cogl_texture_new_from_file ("redhand.png", 64,
|
||||||
COGL_PIXEL_FORMAT_ANY, NULL);
|
COGL_TEXTURE_NONE,
|
||||||
|
COGL_PIXEL_FORMAT_ANY,
|
||||||
|
NULL);
|
||||||
|
|
||||||
label = clutter_text_new_with_text ("Sans 12px", instructions);
|
label = clutter_text_new_with_text ("Sans 12px", instructions);
|
||||||
clutter_text_set_line_wrap (CLUTTER_TEXT (label), TRUE);
|
clutter_text_set_line_wrap (CLUTTER_TEXT (label), TRUE);
|
||||||
|
@ -150,12 +150,14 @@ test_coglbox_init (TestCoglbox *self)
|
|||||||
self->priv = priv = TEST_COGLBOX_GET_PRIVATE(self);
|
self->priv = priv = TEST_COGLBOX_GET_PRIVATE(self);
|
||||||
|
|
||||||
printf ("Loading redhand.png\n");
|
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,
|
COGL_PIXEL_FORMAT_ANY,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
printf ("Creating texture with size\n");
|
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);
|
COGL_PIXEL_FORMAT_RGB_888);
|
||||||
|
|
||||||
if (priv->texture_id == COGL_INVALID_HANDLE)
|
if (priv->texture_id == COGL_INVALID_HANDLE)
|
||||||
|
@ -159,19 +159,23 @@ test_coglbox_init (TestCoglbox *self)
|
|||||||
self->priv = priv = TEST_COGLBOX_GET_PRIVATE(self);
|
self->priv = priv = TEST_COGLBOX_GET_PRIVATE(self);
|
||||||
|
|
||||||
priv->cogl_tex_id[0] =
|
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);
|
COGL_PIXEL_FORMAT_ANY, NULL);
|
||||||
|
|
||||||
priv->cogl_tex_id[1] =
|
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);
|
COGL_PIXEL_FORMAT_BGRA_8888, NULL);
|
||||||
|
|
||||||
priv->cogl_tex_id[2] =
|
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);
|
COGL_PIXEL_FORMAT_ARGB_8888, NULL);
|
||||||
|
|
||||||
priv->cogl_tex_id[3] =
|
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);
|
COGL_PIXEL_FORMAT_G_8, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -141,7 +141,8 @@ test_coglbox_init (TestCoglbox *self)
|
|||||||
/* Load image from file */
|
/* Load image from file */
|
||||||
|
|
||||||
priv->cogl_tex_id[0] =
|
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);
|
COGL_PIXEL_FORMAT_ANY, NULL);
|
||||||
|
|
||||||
if (priv->cogl_tex_id[0] == COGL_INVALID_HANDLE)
|
if (priv->cogl_tex_id[0] == COGL_INVALID_HANDLE)
|
||||||
@ -176,7 +177,8 @@ test_coglbox_init (TestCoglbox *self)
|
|||||||
/* Create new texture from modified data */
|
/* Create new texture from modified data */
|
||||||
|
|
||||||
priv->cogl_tex_id[1] =
|
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,
|
format, format,
|
||||||
rowstride, data);
|
rowstride, data);
|
||||||
|
|
||||||
|
@ -248,21 +248,37 @@ test_coglbox_init (TestCoglbox *self)
|
|||||||
priv->use_linear_filtering = FALSE;
|
priv->use_linear_filtering = FALSE;
|
||||||
priv->use_sliced = FALSE;
|
priv->use_sliced = FALSE;
|
||||||
|
|
||||||
priv->sliced_tex = cogl_texture_new_from_file
|
priv->sliced_tex =
|
||||||
("redhand.png", 10, FALSE, COGL_PIXEL_FORMAT_ANY, &error);
|
cogl_texture_new_from_file ("redhand.png", 10,
|
||||||
if (priv->sliced_tex == NULL)
|
COGL_TEXTURE_NONE,
|
||||||
|
COGL_PIXEL_FORMAT_ANY,
|
||||||
|
&error);
|
||||||
|
if (priv->sliced_tex == COGL_INVALID_HANDLE)
|
||||||
{
|
{
|
||||||
g_warning ("Texture loading failed: %s", error->message);
|
if (error)
|
||||||
g_error_free (error);
|
{
|
||||||
error = NULL;
|
g_warning ("Texture loading failed: %s", error->message);
|
||||||
|
g_error_free (error);
|
||||||
|
error = NULL;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
g_warning ("Texture loading failed: <unknown>");
|
||||||
}
|
}
|
||||||
|
|
||||||
priv->not_sliced_tex = cogl_texture_new_from_file
|
priv->not_sliced_tex =
|
||||||
("redhand.png", -1, FALSE, COGL_PIXEL_FORMAT_ANY, &error);
|
cogl_texture_new_from_file ("redhand.png", -1,
|
||||||
if (priv->not_sliced_tex == NULL)
|
COGL_TEXTURE_NONE,
|
||||||
|
COGL_PIXEL_FORMAT_ANY,
|
||||||
|
&error);
|
||||||
|
if (priv->not_sliced_tex == COGL_INVALID_HANDLE)
|
||||||
{
|
{
|
||||||
g_warning ("Texture loading failed: %s", error->message);
|
if (error)
|
||||||
g_error_free (error);
|
{
|
||||||
|
g_warning ("Texture loading failed: %s", error->message);
|
||||||
|
g_error_free (error);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
g_warning ("Texture loading failed: <unknown>");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -150,7 +150,8 @@ test_coglbox_init (TestCoglbox *self)
|
|||||||
TestCoglboxPrivate *priv;
|
TestCoglboxPrivate *priv;
|
||||||
self->priv = priv = TEST_COGLBOX_GET_PRIVATE(self);
|
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,
|
COGL_PIXEL_FORMAT_ANY,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user