summaryrefslogtreecommitdiff
path: root/tests/conform
diff options
context:
space:
mode:
authorRobert Bragg <robert@linux.intel.com>2013-07-02 01:48:54 +0100
committerRobert Bragg <robert@linux.intel.com>2014-01-01 17:43:13 +0000
commit99a53c82e9ab0a1e5ee35941bf83dc334b1fbe87 (patch)
treea0e867283b7aa09a0e690c44f80742a891298e0c /tests/conform
parent6a83de9ef4210f380a31f410797447b365a8d02c (diff)
downloadcogl-99a53c82e9ab0a1e5ee35941bf83dc334b1fbe87.tar.gz
remove internal_format and redundant error arguments
Texture allocation is now consistently handled lazily such that the internal format can now be controlled using cogl_texture_set_components() and cogl_texture_set_premultiplied() before allocating the texture with cogl_texture_allocate(). This means that the internal_format arguments to texture constructors are now redundant and since most of the texture constructors now can't ever fail the error arguments are also redundant. This now means we no longer use CoglPixelFormat in the public api for describing the internal format of textures which had been bad solution originally due to how specific CoglPixelFormat is which is missleading when we don't support such explicit control over the internal format. Reviewed-by: Neil Roberts <neil@linux.intel.com>
Diffstat (limited to 'tests/conform')
-rw-r--r--tests/conform/test-alpha-test.c1
-rw-r--r--tests/conform/test-alpha-textures.c1
-rw-r--r--tests/conform/test-atlas-migration.c6
-rw-r--r--tests/conform/test-backface-culling.c4
-rw-r--r--tests/conform/test-blend-strings.c7
-rw-r--r--tests/conform/test-color-mask.c2
-rw-r--r--tests/conform/test-copy-replace-texture.c1
-rw-r--r--tests/conform/test-framebuffer-get-bits.c8
-rw-r--r--tests/conform/test-gles2-context.c6
-rw-r--r--tests/conform/test-just-vertex-shader.c1
-rw-r--r--tests/conform/test-map-buffer-range.c1
-rw-r--r--tests/conform/test-npot-texture.c1
-rw-r--r--tests/conform/test-offscreen.c6
-rw-r--r--tests/conform/test-pipeline-cache-unrefs-texture.c1
-rw-r--r--tests/conform/test-pipeline-shader-state.c3
-rw-r--r--tests/conform/test-pixel-buffer.c5
-rw-r--r--tests/conform/test-point-sprite.c1
-rw-r--r--tests/conform/test-premult.c57
-rw-r--r--tests/conform/test-primitive.c1
-rw-r--r--tests/conform/test-read-texture-formats.c1
-rw-r--r--tests/conform/test-snippets.c1
-rw-r--r--tests/conform/test-sub-texture.c2
-rw-r--r--tests/conform/test-texture-3d.c3
-rw-r--r--tests/conform/test-texture-get-set-data.c16
-rw-r--r--tests/conform/test-texture-mipmap-get-set.c1
-rw-r--r--tests/conform/test-texture-no-allocate.c14
-rw-r--r--tests/conform/test-wrap-modes.c1
-rw-r--r--tests/conform/test-wrap-rectangle-textures.c5
28 files changed, 65 insertions, 92 deletions
diff --git a/tests/conform/test-alpha-test.c b/tests/conform/test-alpha-test.c
index f164ede6..e74f6d8e 100644
--- a/tests/conform/test-alpha-test.c
+++ b/tests/conform/test-alpha-test.c
@@ -15,7 +15,6 @@ create_texture (CoglContext *context)
return cogl_texture_2d_new_from_data (context,
2, 1, /* width/height */
COGL_PIXEL_FORMAT_RGBA_8888_PRE,
- COGL_PIXEL_FORMAT_ANY,
4, /* rowstride */
data,
NULL /* error */);
diff --git a/tests/conform/test-alpha-textures.c b/tests/conform/test-alpha-textures.c
index 524ba895..f4ad49bb 100644
--- a/tests/conform/test-alpha-textures.c
+++ b/tests/conform/test-alpha-textures.c
@@ -16,7 +16,6 @@ create_pipeline (CoglTexture **tex_out,
tex = cogl_texture_2d_new_from_data (test_ctx,
2, 2, /* width/height */
COGL_PIXEL_FORMAT_A_8, /* format */
- COGL_PIXEL_FORMAT_ANY, /* int. format */
2, /* rowstride */
tex_data,
NULL);
diff --git a/tests/conform/test-atlas-migration.c b/tests/conform/test-atlas-migration.c
index f8435bcc..39e8a3c1 100644
--- a/tests/conform/test-atlas-migration.c
+++ b/tests/conform/test-atlas-migration.c
@@ -58,9 +58,7 @@ create_texture (int size)
size, /* height */
TEST_UTILS_TEXTURE_NONE, /* flags */
/* format */
- COGL_PIXEL_FORMAT_RGBA_8888,
- /* internal format */
- COGL_PIXEL_FORMAT_RGBA_8888,
+ COGL_PIXEL_FORMAT_RGBA_8888_PRE,
/* rowstride */
size * 4,
data);
@@ -82,7 +80,7 @@ verify_texture (CoglTexture *texture, int size)
p = data = g_malloc (size * size * 4);
cogl_texture_get_data (texture,
- COGL_PIXEL_FORMAT_RGBA_8888,
+ COGL_PIXEL_FORMAT_RGBA_8888_PRE,
size * 4,
data);
diff --git a/tests/conform/test-backface-culling.c b/tests/conform/test-backface-culling.c
index 3ff84f68..02836d82 100644
--- a/tests/conform/test-backface-culling.c
+++ b/tests/conform/test-backface-culling.c
@@ -215,7 +215,6 @@ make_texture (void)
TEXTURE_SIZE,
TEST_UTILS_TEXTURE_NO_ATLAS,
COGL_PIXEL_FORMAT_RGBA_8888,
- COGL_PIXEL_FORMAT_ANY,
TEXTURE_SIZE * 4,
tex_data);
@@ -240,8 +239,7 @@ test_backface_culling (void)
tex = test_utils_texture_new_with_size (test_ctx,
state.width, state.height,
TEST_UTILS_TEXTURE_NO_SLICING,
- COGL_PIXEL_FORMAT_ANY); /* internal
- format */
+ COGL_TEXTURE_COMPONENTS_RGBA);
state.offscreen = cogl_offscreen_new_with_texture (tex);
state.offscreen_tex = tex;
diff --git a/tests/conform/test-blend-strings.c b/tests/conform/test-blend-strings.c
index 34049d57..4c1a09b9 100644
--- a/tests/conform/test-blend-strings.c
+++ b/tests/conform/test-blend-strings.c
@@ -142,14 +142,13 @@ make_texture (uint32_t color)
*(--p) = r;
}
- /* Note: we don't use COGL_PIXEL_FORMAT_ANY for the internal format here
- * since we don't want to allow Cogl to premultiply our data. */
+ /* Note: we claim that the data is premultiplied so that Cogl won't
+ * premultiply the data on upload */
tex = test_utils_texture_new_from_data (test_ctx,
QUAD_WIDTH,
QUAD_WIDTH,
TEST_UTILS_TEXTURE_NONE,
- COGL_PIXEL_FORMAT_RGBA_8888,
- COGL_PIXEL_FORMAT_RGBA_8888,
+ COGL_PIXEL_FORMAT_RGBA_8888_PRE,
QUAD_WIDTH * 4,
tex_data);
diff --git a/tests/conform/test-color-mask.c b/tests/conform/test-color-mask.c
index 41056afa..4cbfb983 100644
--- a/tests/conform/test-color-mask.c
+++ b/tests/conform/test-color-mask.c
@@ -83,7 +83,7 @@ test_color_mask (void)
{
state.tex[i] = test_utils_texture_new_with_size (test_ctx, 128, 128,
TEST_UTILS_TEXTURE_NO_ATLAS,
- COGL_PIXEL_FORMAT_RGB_888);
+ COGL_TEXTURE_COMPONENTS_RGB);
state.fbo[i] = cogl_offscreen_new_with_texture (state.tex[i]);
diff --git a/tests/conform/test-copy-replace-texture.c b/tests/conform/test-copy-replace-texture.c
index 47b0ae83..f11070ee 100644
--- a/tests/conform/test-copy-replace-texture.c
+++ b/tests/conform/test-copy-replace-texture.c
@@ -37,7 +37,6 @@ create_texture (void)
tex_2d = cogl_texture_2d_new_from_data (test_ctx,
1, 1, /* width / height */
COGL_PIXEL_FORMAT_RGBA_8888_PRE,
- COGL_PIXEL_FORMAT_ANY,
4, /* rowstride */
data,
NULL);
diff --git a/tests/conform/test-framebuffer-get-bits.c b/tests/conform/test-framebuffer-get-bits.c
index c4a1dc40..31c220d7 100644
--- a/tests/conform/test-framebuffer-get-bits.c
+++ b/tests/conform/test-framebuffer-get-bits.c
@@ -7,19 +7,19 @@ test_framebuffer_get_bits (void)
{
CoglTexture2D *tex_a =
cogl_texture_2d_new_with_size (test_ctx,
- 16, 16, /* width/height */
- COGL_PIXEL_FORMAT_A_8);
+ 16, 16); /* width/height */
CoglOffscreen *offscreen_a =
cogl_offscreen_new_with_texture (tex_a);
CoglFramebuffer *fb_a = offscreen_a;
CoglTexture2D *tex_rgba =
cogl_texture_2d_new_with_size (test_ctx,
- 16, 16, /* width/height */
- COGL_PIXEL_FORMAT_RGBA_8888);
+ 16, 16); /* width/height */
CoglOffscreen *offscreen_rgba =
cogl_offscreen_new_with_texture (tex_rgba);
CoglFramebuffer *fb_rgba = offscreen_rgba;
+ cogl_texture_set_components (tex_a,
+ COGL_TEXTURE_COMPONENTS_A);
cogl_framebuffer_allocate (fb_a, NULL);
cogl_framebuffer_allocate (fb_rgba, NULL);
diff --git a/tests/conform/test-gles2-context.c b/tests/conform/test-gles2-context.c
index 1f2087d0..5e1d2784 100644
--- a/tests/conform/test-gles2-context.c
+++ b/tests/conform/test-gles2-context.c
@@ -26,8 +26,7 @@ test_push_pop_single_context (void)
offscreen_texture =
cogl_texture_2d_new_with_size (test_ctx,
cogl_framebuffer_get_width (test_fb),
- cogl_framebuffer_get_height (test_fb),
- COGL_PIXEL_FORMAT_ANY);
+ cogl_framebuffer_get_height (test_fb));
offscreen = cogl_offscreen_new_with_texture (offscreen_texture);
pipeline = cogl_pipeline_new (test_ctx);
@@ -150,8 +149,7 @@ create_gles2_context (CoglTexture **offscreen_texture,
*offscreen_texture =
cogl_texture_2d_new_with_size (test_ctx,
cogl_framebuffer_get_width (test_fb),
- cogl_framebuffer_get_height (test_fb),
- COGL_PIXEL_FORMAT_ANY);
+ cogl_framebuffer_get_height (test_fb));
*offscreen = cogl_offscreen_new_with_texture (*offscreen_texture);
*pipeline = cogl_pipeline_new (test_ctx);
diff --git a/tests/conform/test-just-vertex-shader.c b/tests/conform/test-just-vertex-shader.c
index 355b57d8..1ed951c8 100644
--- a/tests/conform/test-just-vertex-shader.c
+++ b/tests/conform/test-just-vertex-shader.c
@@ -20,7 +20,6 @@ create_dummy_texture (void)
1, 1, /* size */
TEST_UTILS_TEXTURE_NONE,
COGL_PIXEL_FORMAT_RGB_888,
- COGL_PIXEL_FORMAT_ANY,
4, /* rowstride */
data);
}
diff --git a/tests/conform/test-map-buffer-range.c b/tests/conform/test-map-buffer-range.c
index e3f7b398..e9792405 100644
--- a/tests/conform/test-map-buffer-range.c
+++ b/tests/conform/test-map-buffer-range.c
@@ -37,7 +37,6 @@ test_map_buffer_range (void)
tex = cogl_texture_2d_new_from_data (test_ctx,
2, 2, /* width/height */
COGL_PIXEL_FORMAT_RGBA_8888_PRE,
- COGL_PIXEL_FORMAT_ANY,
2 * 4, /* rowstride */
tex_data,
NULL /* error */);
diff --git a/tests/conform/test-npot-texture.c b/tests/conform/test-npot-texture.c
index 3460fed6..85c16c96 100644
--- a/tests/conform/test-npot-texture.c
+++ b/tests/conform/test-npot-texture.c
@@ -92,7 +92,6 @@ make_texture (void)
TEXTURE_SIZE,
TEST_UTILS_TEXTURE_NO_ATLAS,
COGL_PIXEL_FORMAT_RGBA_8888_PRE,
- COGL_PIXEL_FORMAT_ANY,
TEXTURE_SIZE * 4,
tex_data);
diff --git a/tests/conform/test-offscreen.c b/tests/conform/test-offscreen.c
index 9134cc9e..dc329680 100644
--- a/tests/conform/test-offscreen.c
+++ b/tests/conform/test-offscreen.c
@@ -46,8 +46,7 @@ test_paint (TestState *state)
tex_2d = cogl_texture_2d_new_with_size (test_ctx,
state->fb_width,
- state->fb_height,
- COGL_PIXEL_FORMAT_RGBA_8888_PRE);
+ state->fb_height);
tex = tex_2d;
offscreen = cogl_offscreen_new_with_texture (tex);
@@ -126,8 +125,7 @@ test_flush (TestState *state)
journal */
tex_2d = cogl_texture_2d_new_with_size (test_ctx,
- 16, 16, /* width/height */
- COGL_PIXEL_FORMAT_RGBA_8888_PRE);
+ 16, 16); /* width/height */
tex = tex_2d;
offscreen = cogl_offscreen_new_with_texture (tex);
diff --git a/tests/conform/test-pipeline-cache-unrefs-texture.c b/tests/conform/test-pipeline-cache-unrefs-texture.c
index f00a4cb4..5d278dcd 100644
--- a/tests/conform/test-pipeline-cache-unrefs-texture.c
+++ b/tests/conform/test-pipeline-cache-unrefs-texture.c
@@ -25,7 +25,6 @@ create_texture (void)
tex_2d = cogl_texture_2d_new_from_data (test_ctx,
1, 1, /* width / height */
COGL_PIXEL_FORMAT_RGBA_8888_PRE,
- COGL_PIXEL_FORMAT_ANY,
4, /* rowstride */
data,
NULL);
diff --git a/tests/conform/test-pipeline-shader-state.c b/tests/conform/test-pipeline-shader-state.c
index 5ac7b093..4d1e5f2b 100644
--- a/tests/conform/test-pipeline-shader-state.c
+++ b/tests/conform/test-pipeline-shader-state.c
@@ -22,8 +22,7 @@ test_pipeline_shader_state (void)
-1,
100);
- tex = cogl_texture_2d_new_with_size (test_ctx,
- 128, 128, COGL_PIXEL_FORMAT_ANY);
+ tex = cogl_texture_2d_new_with_size (test_ctx, 128, 128);
offscreen = cogl_offscreen_new_with_texture (tex);
fb = offscreen;
cogl_framebuffer_clear4f (fb, COGL_BUFFER_BIT_COLOR, 0, 0, 0, 1);
diff --git a/tests/conform/test-pixel-buffer.c b/tests/conform/test-pixel-buffer.c
index a36430f2..d3102f27 100644
--- a/tests/conform/test-pixel-buffer.c
+++ b/tests/conform/test-pixel-buffer.c
@@ -80,9 +80,7 @@ create_texture_from_bitmap (CoglBitmap *bitmap)
{
CoglTexture2D *texture;
- texture = cogl_texture_2d_new_from_bitmap (bitmap,
- COGL_PIXEL_FORMAT_RGBA_8888,
- NULL); /* don't catch errors */
+ texture = cogl_texture_2d_new_from_bitmap (bitmap);
g_assert (texture != NULL);
@@ -223,7 +221,6 @@ create_white_texture (void)
BITMAP_SIZE,
BITMAP_SIZE,
COGL_PIXEL_FORMAT_RGBA_8888,
- COGL_PIXEL_FORMAT_ANY,
BITMAP_SIZE * 4, /* rowstride */
data,
NULL); /* don't catch errors */
diff --git a/tests/conform/test-point-sprite.c b/tests/conform/test-point-sprite.c
index 8de5251e..65ce9a85 100644
--- a/tests/conform/test-point-sprite.c
+++ b/tests/conform/test-point-sprite.c
@@ -51,7 +51,6 @@ do_test (CoglBool check_orientation,
tex_2d = cogl_texture_2d_new_from_data (test_ctx,
2, tex_height, /* width/height */
COGL_PIXEL_FORMAT_RGB_888,
- COGL_PIXEL_FORMAT_ANY,
6, /* row stride */
tex_data,
&error);
diff --git a/tests/conform/test-premult.c b/tests/conform/test-premult.c
index 8c7b4d07..816c4873 100644
--- a/tests/conform/test-premult.c
+++ b/tests/conform/test-premult.c
@@ -16,6 +16,12 @@
#define MASK_BLUE(COLOR) ((COLOR & 0xff00) >> 8)
#define MASK_ALPHA(COLOR) (COLOR & 0xff)
+typedef enum _MakeTextureFlags
+{
+ TEXTURE_FLAG_SET_PREMULTIPLIED = 1,
+ TEXTURE_FLAG_SET_UNPREMULTIPLIED = 1<<1,
+} MakeTextureFlags;
+
static guchar *
gen_tex_data (uint32_t color)
{
@@ -41,20 +47,25 @@ gen_tex_data (uint32_t color)
static CoglTexture *
make_texture (uint32_t color,
CoglPixelFormat src_format,
- CoglPixelFormat internal_format)
+ MakeTextureFlags flags)
{
CoglTexture2D *tex_2d;
guchar *tex_data = gen_tex_data (color);
+ CoglBitmap *bmp = cogl_bitmap_new_for_data (test_ctx,
+ QUAD_WIDTH,
+ QUAD_WIDTH,
+ src_format,
+ QUAD_WIDTH * 4,
+ tex_data);
+
+ tex_2d = cogl_texture_2d_new_from_bitmap (bmp);
- tex_2d = cogl_texture_2d_new_from_data (test_ctx,
- QUAD_WIDTH,
- QUAD_WIDTH,
- src_format,
- internal_format,
- QUAD_WIDTH * 4,
- tex_data,
- NULL);
+ if (flags & TEXTURE_FLAG_SET_PREMULTIPLIED)
+ cogl_texture_set_premultiplied (tex_2d, TRUE);
+ else if (flags & TEXTURE_FLAG_SET_UNPREMULTIPLIED)
+ cogl_texture_set_premultiplied (tex_2d, FALSE);
+ cogl_object_unref (bmp);
g_free (tex_data);
return tex_2d;
@@ -125,7 +136,7 @@ test_premult (void)
"src = RGBA_8888, internal = RGBA_8888)\n");
tex = make_texture (0xff00ff80,
COGL_PIXEL_FORMAT_RGBA_8888, /* src format */
- COGL_PIXEL_FORMAT_RGBA_8888); /* internal format */
+ TEXTURE_FLAG_SET_UNPREMULTIPLIED);
check_texture (pipeline, 0, 0, /* position */
tex,
0xff00ff80); /* expected */
@@ -138,21 +149,21 @@ test_premult (void)
"src = RGBA_8888, internal = RGBA_8888_PRE)\n");
tex = make_texture (0xff00ff80,
COGL_PIXEL_FORMAT_RGBA_8888, /* src format */
- COGL_PIXEL_FORMAT_RGBA_8888_PRE); /* internal format */
+ TEXTURE_FLAG_SET_PREMULTIPLIED);
check_texture (pipeline, 1, 0, /* position */
tex,
0x80008080); /* expected */
- /* If the user gives COGL_PIXEL_FORMAT_ANY for the internal format then
- * by default Cogl should premultiply the given texture data...
- * (In the future there will be additional Cogl API to control this
- * behaviour) */
+ /* If the user doesn't explicitly declare that the texture is premultiplied
+ * then Cogl should assume it is by default should premultiply
+ * unpremultiplied texture data...
+ */
if (cogl_test_verbose ())
g_print ("make_texture (0xff00ff80, "
"src = RGBA_8888, internal = ANY)\n");
tex = make_texture (0xff00ff80,
COGL_PIXEL_FORMAT_RGBA_8888, /* src format */
- COGL_PIXEL_FORMAT_ANY); /* internal format */
+ 0); /* default premultiplied status */
check_texture (pipeline, 2, 0, /* position */
tex,
0x80008080); /* expected */
@@ -166,7 +177,7 @@ test_premult (void)
"internal = RGBA_8888_PRE)\n");
tex = make_texture (0x80008080,
COGL_PIXEL_FORMAT_RGBA_8888_PRE, /* src format */
- COGL_PIXEL_FORMAT_RGBA_8888_PRE); /* internal format */
+ TEXTURE_FLAG_SET_PREMULTIPLIED);
check_texture (pipeline, 3, 0, /* position */
tex,
0x80008080); /* expected */
@@ -179,7 +190,7 @@ test_premult (void)
"src = RGBA_8888_PRE, internal = RGBA_8888)\n");
tex = make_texture (0x80008080,
COGL_PIXEL_FORMAT_RGBA_8888_PRE, /* src format */
- COGL_PIXEL_FORMAT_RGBA_8888); /* internal format */
+ TEXTURE_FLAG_SET_UNPREMULTIPLIED);
check_texture (pipeline, 4, 0, /* position */
tex,
0xff00ff80); /* expected */
@@ -193,7 +204,7 @@ test_premult (void)
"src = RGBA_8888_PRE, internal = ANY)\n");
tex = make_texture (0x80008080,
COGL_PIXEL_FORMAT_RGBA_8888_PRE, /* src format */
- COGL_PIXEL_FORMAT_ANY); /* internal format */
+ 0); /* default premultiplied status */
check_texture (pipeline, 5, 0, /* position */
tex,
0x80008080); /* expected */
@@ -207,7 +218,7 @@ test_premult (void)
"src = RGBA_8888, internal = RGBA_8888)\n");
tex = make_texture (0xDEADBEEF,
COGL_PIXEL_FORMAT_RGBA_8888, /* src format */
- COGL_PIXEL_FORMAT_RGBA_8888); /* internal format */
+ TEXTURE_FLAG_SET_UNPREMULTIPLIED);
if (cogl_test_verbose ())
g_print ("set_region (0xff00ff80, RGBA_8888)\n");
set_region (tex, 0xff00ff80, COGL_PIXEL_FORMAT_RGBA_8888);
@@ -223,7 +234,7 @@ test_premult (void)
"src = RGBA_8888, internal = RGBA_8888)\n");
tex = make_texture (0xDEADBEEF,
COGL_PIXEL_FORMAT_RGBA_8888, /* src format */
- COGL_PIXEL_FORMAT_RGBA_8888); /* internal format */
+ TEXTURE_FLAG_SET_UNPREMULTIPLIED);
if (cogl_test_verbose ())
g_print ("set_region (0x80008080, RGBA_8888_PRE)\n");
set_region (tex, 0x80008080, COGL_PIXEL_FORMAT_RGBA_8888_PRE);
@@ -238,7 +249,7 @@ test_premult (void)
"internal = RGBA_8888_PRE)\n");
tex = make_texture (0xDEADBEEF,
COGL_PIXEL_FORMAT_RGBA_8888_PRE, /* src format */
- COGL_PIXEL_FORMAT_RGBA_8888_PRE); /* internal format */
+ TEXTURE_FLAG_SET_PREMULTIPLIED);
if (cogl_test_verbose ())
g_print ("set_region (0x80008080, RGBA_8888_PRE)\n");
set_region (tex, 0x80008080, COGL_PIXEL_FORMAT_RGBA_8888_PRE);
@@ -256,7 +267,7 @@ test_premult (void)
"internal = RGBA_8888_PRE)\n");
tex = make_texture (0xDEADBEEF,
COGL_PIXEL_FORMAT_RGBA_8888_PRE, /* src format */
- COGL_PIXEL_FORMAT_RGBA_8888_PRE); /* internal format */
+ TEXTURE_FLAG_SET_PREMULTIPLIED);
if (cogl_test_verbose ())
g_print ("set_region (0xff00ff80, RGBA_8888)\n");
set_region (tex, 0xff00ff80, COGL_PIXEL_FORMAT_RGBA_8888);
diff --git a/tests/conform/test-primitive.c b/tests/conform/test-primitive.c
index 45166a88..1cd2ffca 100644
--- a/tests/conform/test-primitive.c
+++ b/tests/conform/test-primitive.c
@@ -174,7 +174,6 @@ test_paint (TestState *state)
2, 1, /* size */
TEST_UTILS_TEXTURE_NO_ATLAS,
COGL_PIXEL_FORMAT_RGB_888,
- COGL_PIXEL_FORMAT_ANY,
6, /* rowstride */
tex_data);
pipeline = cogl_pipeline_new (test_ctx);
diff --git a/tests/conform/test-read-texture-formats.c b/tests/conform/test-read-texture-formats.c
index 25195a71..12b04ae9 100644
--- a/tests/conform/test-read-texture-formats.c
+++ b/tests/conform/test-read-texture-formats.c
@@ -149,7 +149,6 @@ test_read_texture_formats (void)
tex_2d = cogl_texture_2d_new_from_data (test_ctx,
1, 1, /* width / height */
COGL_PIXEL_FORMAT_RGBA_8888_PRE,
- COGL_PIXEL_FORMAT_RGBA_8888_PRE,
4, /* rowstride */
tex_data,
NULL);
diff --git a/tests/conform/test-snippets.c b/tests/conform/test-snippets.c
index e8a01250..96f32a08 100644
--- a/tests/conform/test-snippets.c
+++ b/tests/conform/test-snippets.c
@@ -26,7 +26,6 @@ create_texture_pipeline (TestState *state)
2, 2, /* width/height */
TEST_UTILS_TEXTURE_NO_ATLAS,
COGL_PIXEL_FORMAT_RGBA_8888_PRE,
- COGL_PIXEL_FORMAT_ANY,
8, /* rowstride */
tex_data);
diff --git a/tests/conform/test-sub-texture.c b/tests/conform/test-sub-texture.c
index c58244a7..cec5b67d 100644
--- a/tests/conform/test-sub-texture.c
+++ b/tests/conform/test-sub-texture.c
@@ -57,7 +57,6 @@ create_source (TestState *state)
tex = cogl_texture_2d_new_from_data (test_ctx,
SOURCE_SIZE, SOURCE_SIZE,
COGL_PIXEL_FORMAT_RGBA_8888,
- COGL_PIXEL_FORMAT_ANY,
SOURCE_SIZE * 4,
data,
NULL);
@@ -87,7 +86,6 @@ create_test_texture (TestState *state)
tex = cogl_texture_2d_new_from_data (test_ctx,
256, 256,
COGL_PIXEL_FORMAT_RGBA_8888_PRE,
- COGL_PIXEL_FORMAT_ANY,
256 * 4,
data,
NULL);
diff --git a/tests/conform/test-texture-3d.c b/tests/conform/test-texture-3d.c
index e4c959b8..80d077a1 100644
--- a/tests/conform/test-texture-3d.c
+++ b/tests/conform/test-texture-3d.c
@@ -52,7 +52,6 @@ create_texture_3d (CoglContext *context)
tex = cogl_texture_3d_new_from_data (context,
TEX_WIDTH, TEX_HEIGHT, TEX_DEPTH,
COGL_PIXEL_FORMAT_RGBA_8888,
- COGL_PIXEL_FORMAT_ANY,
TEX_ROWSTRIDE,
TEX_IMAGE_STRIDE,
data,
@@ -217,7 +216,6 @@ test_multi_texture (TestState *state)
tex_2d = cogl_texture_2d_new_from_data (test_ctx,
1, 1, /* width/height */
COGL_PIXEL_FORMAT_RGBA_8888_PRE,
- COGL_PIXEL_FORMAT_RGBA_8888_PRE,
4, /* rowstride */
tex_data,
NULL);
@@ -230,7 +228,6 @@ test_multi_texture (TestState *state)
tex_3d = cogl_texture_3d_new_from_data (test_ctx,
1, 1, 1, /* width/height/depth */
COGL_PIXEL_FORMAT_RGBA_8888_PRE,
- COGL_PIXEL_FORMAT_RGBA_8888_PRE,
4, /* rowstride */
4, /* image_stride */
tex_data,
diff --git a/tests/conform/test-texture-get-set-data.c b/tests/conform/test-texture-get-set-data.c
index 4c66f276..626823d7 100644
--- a/tests/conform/test-texture-get-set-data.c
+++ b/tests/conform/test-texture-get-set-data.c
@@ -11,6 +11,7 @@ check_texture (int width, int height, TestUtilsTextureFlags flags)
uint8_t *data, *p;
int y, x;
int rowstride;
+ CoglBitmap *bmp;
p = data = g_malloc (width * height * 4);
for (y = 0; y < height; y++)
@@ -22,13 +23,14 @@ check_texture (int width, int height, TestUtilsTextureFlags flags)
*(p++) = (x ^ y);
}
- tex = test_utils_texture_new_from_data (test_ctx,
- width, height,
- flags,
- COGL_PIXEL_FORMAT_RGBA_8888,
- COGL_PIXEL_FORMAT_RGBA_8888,
- width * 4,
- data);
+ bmp = cogl_bitmap_new_for_data (test_ctx,
+ width, height,
+ COGL_PIXEL_FORMAT_RGBA_8888,
+ width * 4,
+ data);
+
+ tex = test_utils_texture_new_from_bitmap (bmp, flags,
+ FALSE);
/* Replace the bottom right quarter of the data with negated data to
test set_region */
diff --git a/tests/conform/test-texture-mipmap-get-set.c b/tests/conform/test-texture-mipmap-get-set.c
index 9cd86f0b..c4cd0be4 100644
--- a/tests/conform/test-texture-mipmap-get-set.c
+++ b/tests/conform/test-texture-mipmap-get-set.c
@@ -31,7 +31,6 @@ make_texture (void)
TEXTURE_SIZE,
TEST_UTILS_TEXTURE_NO_ATLAS,
COGL_PIXEL_FORMAT_RGBA_8888_PRE,
- COGL_PIXEL_FORMAT_ANY,
TEXTURE_SIZE * 4,
tex_data);
diff --git a/tests/conform/test-texture-no-allocate.c b/tests/conform/test-texture-no-allocate.c
index fb73e23f..5bce8f67 100644
--- a/tests/conform/test-texture-no-allocate.c
+++ b/tests/conform/test-texture-no-allocate.c
@@ -32,8 +32,6 @@ test_texture_no_allocate (void)
BIG_TEX_HEIGHT,
/* format */
COGL_PIXEL_FORMAT_RGBA_8888_PRE,
- /* internal format */
- COGL_PIXEL_FORMAT_ANY,
/* rowstride */
BIG_TEX_WIDTH * 4,
tex_data,
@@ -54,14 +52,12 @@ test_texture_no_allocate (void)
cogl_texture_2d_sliced_new_with_size (test_ctx,
BIG_TEX_WIDTH,
BIG_TEX_HEIGHT,
- COGL_TEXTURE_MAX_WASTE,
- COGL_PIXEL_FORMAT_RGBA_8888_PRE);
+ COGL_TEXTURE_MAX_WASTE);
cogl_object_unref (texture);
/* 2D texture */
texture_2d = cogl_texture_2d_new_with_size (test_ctx,
- 64, 64,
- COGL_PIXEL_FORMAT_RGBA_8888_PRE);
+ 64, 64);
cogl_object_unref (texture_2d);
/* 3D texture */
@@ -69,8 +65,7 @@ test_texture_no_allocate (void)
{
CoglTexture3D *texture_3d =
cogl_texture_3d_new_with_size (test_ctx,
- 64, 64, 64,
- COGL_PIXEL_FORMAT_RGBA_8888_PRE);
+ 64, 64, 64);
cogl_object_unref (texture_3d);
}
@@ -79,8 +74,7 @@ test_texture_no_allocate (void)
{
CoglTextureRectangle *texture_rect =
cogl_texture_rectangle_new_with_size (test_ctx,
- 64, 64,
- COGL_PIXEL_FORMAT_RGBA_8888_PRE);
+ 64, 64);
cogl_object_unref (texture_rect);
}
}
diff --git a/tests/conform/test-wrap-modes.c b/tests/conform/test-wrap-modes.c
index b5f11acd..5aea0eb0 100644
--- a/tests/conform/test-wrap-modes.c
+++ b/tests/conform/test-wrap-modes.c
@@ -31,7 +31,6 @@ create_texture (TestUtilsTextureFlags flags)
tex = test_utils_texture_new_from_data (test_ctx,
TEX_SIZE, TEX_SIZE, flags,
COGL_PIXEL_FORMAT_RGBA_8888_PRE,
- COGL_PIXEL_FORMAT_ANY,
TEX_SIZE * 4,
data);
g_free (data);
diff --git a/tests/conform/test-wrap-rectangle-textures.c b/tests/conform/test-wrap-rectangle-textures.c
index 4274c989..73b35753 100644
--- a/tests/conform/test-wrap-rectangle-textures.c
+++ b/tests/conform/test-wrap-rectangle-textures.c
@@ -24,10 +24,7 @@ create_base_pipeline (void)
2 * 3, /* rowstride */
tex_data);
- tex = cogl_texture_rectangle_new_from_bitmap (bmp,
- /* internal format */
- COGL_PIXEL_FORMAT_ANY,
- NULL);
+ tex = cogl_texture_rectangle_new_from_bitmap (bmp);
cogl_object_unref (bmp);