summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRobert Bragg <robert@linux.intel.com>2012-11-09 17:55:54 +0000
committerRobert Bragg <robert@linux.intel.com>2012-11-27 19:04:15 +0000
commit3a336a8adcd406b53731a6de0e7d97ba7932c1a8 (patch)
treec1480c4ae9b2972dd1890428f679e4a79a28f0b6 /tests
parent1206a05358dfedd96a865ec084229c69dd4f36d2 (diff)
downloadcogl-3a336a8adcd406b53731a6de0e7d97ba7932c1a8.tar.gz
texture: expose mipmap level in set region apis
cogl_texture_set_region() and cogl_texture_set_region_from_bitmap() now have a level argument so image data can be uploaded to a specific mipmap level. The prototype for cogl_texture_set_region was also updated to simplify the arguments. The arguments for cogl_texture_set_region_from_bitmap were reordered to be consistent with cogl_texture_set_region with the source related arguments listed first followed by the destination arguments. Reviewed-by: Neil Roberts <neil@linux.intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/conform/test-alpha-textures.c5
-rw-r--r--tests/conform/test-premult.c7
-rw-r--r--tests/conform/test-sub-texture.c8
-rw-r--r--tests/conform/test-write-texture-formats.c20
4 files changed, 19 insertions, 21 deletions
diff --git a/tests/conform/test-alpha-textures.c b/tests/conform/test-alpha-textures.c
index 1861536f..659815c8 100644
--- a/tests/conform/test-alpha-textures.c
+++ b/tests/conform/test-alpha-textures.c
@@ -64,13 +64,12 @@ test_alpha_textures (void)
create_pipeline (&tex2, &pipeline2);
cogl_texture_set_region (tex2,
- 0, 0, /* src_x/y */
- 1, 1, /* dst_x/y */
- 1, 1, /* dst_width / dst_height */
1, 1, /* width / height */
COGL_PIXEL_FORMAT_A_8,
1, /* rowstride */
replacement_data,
+ 1, 1, /* dst_x/y */
+ 0, /* level */
NULL); /* abort on error */
cogl_framebuffer_draw_rectangle (test_fb,
diff --git a/tests/conform/test-premult.c b/tests/conform/test-premult.c
index 32983b75..a960409a 100644
--- a/tests/conform/test-premult.c
+++ b/tests/conform/test-premult.c
@@ -68,13 +68,12 @@ set_region (CoglTexture *tex,
guchar *tex_data = gen_tex_data (color);
cogl_texture_set_region (tex,
- 0, 0, /* src x, y */
- 0, 0, /* dst x, y */
- QUAD_WIDTH, QUAD_WIDTH, /* dst width, height */
- QUAD_WIDTH, QUAD_WIDTH, /* src width, height */
+ QUAD_WIDTH, QUAD_WIDTH, /* height */
format,
0, /* auto compute row stride */
tex_data,
+ 0, 0, /* dst x,y */
+ 0, /* level */
NULL); /* don't catch errors */
}
diff --git a/tests/conform/test-sub-texture.c b/tests/conform/test-sub-texture.c
index 58585562..e81f7b1c 100644
--- a/tests/conform/test-sub-texture.c
+++ b/tests/conform/test-sub-texture.c
@@ -266,10 +266,14 @@ validate_result (TestState *state)
/* Update the center half of the sub texture */
texture_data = create_update_data ();
cogl_texture_set_region (COGL_TEXTURE (sub_texture),
- 0, 0, 32, 32, 64, 64, 256, 256,
- COGL_PIXEL_FORMAT_RGBA_8888_PRE, 256 * 4,
+ 64, 64,
+ COGL_PIXEL_FORMAT_RGBA_8888_PRE,
+ 256 * 4,
texture_data,
+ 32, 32, /* dst x, y */
+ 0, /* level */
NULL); /* don't catch errors */
+
g_free (texture_data);
cogl_object_unref (sub_texture);
/* Get the texture data */
diff --git a/tests/conform/test-write-texture-formats.c b/tests/conform/test-write-texture-formats.c
index 80002f1b..87450147 100644
--- a/tests/conform/test-write-texture-formats.c
+++ b/tests/conform/test-write-texture-formats.c
@@ -38,13 +38,12 @@ test_write_byte (CoglPixelFormat format,
CoglTexture *texture = test_utils_create_color_texture (test_ctx, 0);
cogl_texture_set_region (texture,
- 0, 0, /* src_x / src_y */
- 0, 0, /* dst_x / dst_y */
- 1, 1, /* dst_w / dst_h */
1, 1, /* width / height */
format,
1, /* rowstride */
&byte,
+ 0, 0, /* dst_x, dst_y */
+ 0, /* level */
NULL); /* don't catch errors */
test_color (texture, expected_pixel);
@@ -60,13 +59,12 @@ test_write_short (CoglPixelFormat format,
CoglTexture *texture = test_utils_create_color_texture (test_ctx, 0);
cogl_texture_set_region (texture,
- 0, 0, /* src_x / src_y */
- 0, 0, /* dst_x / dst_y */
- 1, 1, /* dst_w / dst_h */
1, 1, /* width / height */
format,
2, /* rowstride */
(uint8_t *) &value,
+ 0, 0, /* dst_x, dst_y */
+ 0, /* level */
NULL); /* don't catch errors */
test_color (texture, expected_pixel);
@@ -84,13 +82,12 @@ test_write_bytes (CoglPixelFormat format,
value = GUINT32_TO_BE (value);
cogl_texture_set_region (texture,
- 0, 0, /* src_x / src_y */
- 0, 0, /* dst_x / dst_y */
- 1, 1, /* dst_w / dst_h */
1, 1, /* width / height */
format,
4, /* rowstride */
(uint8_t *) &value,
+ 0, 0, /* dst_x, dst_y */
+ 0, /* level */
NULL); /* don't catch errors */
test_color (texture, expected_pixel);
@@ -124,13 +121,12 @@ test_write_int (CoglPixelFormat format,
va_end (ap);
cogl_texture_set_region (texture,
- 0, 0, /* src_x / src_y */
- 0, 0, /* dst_x / dst_y */
- 1, 1, /* dst_w / dst_h */
1, 1, /* width / height */
format,
4, /* rowstride */
(uint8_t *) &tex_data,
+ 0, 0, /* dst_x, dst_y */
+ 0, /* level */
NULL); /* don't catch errors */
test_color (texture, expected_pixel);