diff options
Diffstat (limited to 'cogl/tests/conform/test-premult.c')
-rw-r--r-- | cogl/tests/conform/test-premult.c | 40 |
1 files changed, 10 insertions, 30 deletions
diff --git a/cogl/tests/conform/test-premult.c b/cogl/tests/conform/test-premult.c index 384b46416..70a67318a 100644 --- a/cogl/tests/conform/test-premult.c +++ b/cogl/tests/conform/test-premult.c @@ -91,23 +91,11 @@ set_region (CoglTexture *tex, static void check_texture (CoglPipeline *pipeline, - CoglHandle material, int x, int y, CoglTexture *tex, uint32_t expected_result) { - /* Legacy */ - cogl_push_framebuffer (test_fb); - cogl_material_set_layer (material, 0, tex); - cogl_set_source (material); - cogl_rectangle (x * QUAD_WIDTH, - y * QUAD_WIDTH, - x * QUAD_WIDTH + QUAD_WIDTH, - y * QUAD_WIDTH + QUAD_WIDTH); - test_utils_check_pixel (test_fb, x * QUAD_WIDTH + QUAD_WIDTH / 2, y * QUAD_WIDTH + QUAD_WIDTH / 2, expected_result); - cogl_pop_framebuffer (); - /* New API */ cogl_pipeline_set_layer_texture (pipeline, 0, tex); cogl_framebuffer_draw_rectangle (test_fb, pipeline, @@ -122,7 +110,6 @@ void test_premult (void) { CoglPipeline *pipeline; - CoglHandle material; CoglTexture *tex; cogl_framebuffer_orthographic (test_fb, 0, 0, @@ -135,13 +122,6 @@ test_premult (void) COGL_BUFFER_BIT_COLOR, 1.0f, 1.0f, 1.0f, 1.0f); - /* Legacy */ - material = cogl_material_new (); - cogl_material_set_blend (material, - "RGBA = ADD (SRC_COLOR, 0)", NULL); - cogl_material_set_layer_combine (material, 0, - "RGBA = REPLACE (TEXTURE)", NULL); - /* New API */ pipeline = cogl_pipeline_new (test_ctx); cogl_pipeline_set_blend (pipeline, @@ -157,7 +137,7 @@ test_premult (void) tex = make_texture (0xff00ff80, COGL_PIXEL_FORMAT_RGBA_8888, /* src format */ TEXTURE_FLAG_SET_UNPREMULTIPLIED); - check_texture (pipeline, material, 0, 0, /* position */ + check_texture (pipeline, 0, 0, /* position */ tex, 0xff00ff80); /* expected */ @@ -170,7 +150,7 @@ test_premult (void) tex = make_texture (0xff00ff80, COGL_PIXEL_FORMAT_RGBA_8888, /* src format */ TEXTURE_FLAG_SET_PREMULTIPLIED); - check_texture (pipeline, material, 1, 0, /* position */ + check_texture (pipeline, 1, 0, /* position */ tex, 0x80008080); /* expected */ @@ -184,7 +164,7 @@ test_premult (void) tex = make_texture (0xff00ff80, COGL_PIXEL_FORMAT_RGBA_8888, /* src format */ 0); /* default premultiplied status */ - check_texture (pipeline, material, 2, 0, /* position */ + check_texture (pipeline, 2, 0, /* position */ tex, 0x80008080); /* expected */ @@ -198,7 +178,7 @@ test_premult (void) tex = make_texture (0x80008080, COGL_PIXEL_FORMAT_RGBA_8888_PRE, /* src format */ TEXTURE_FLAG_SET_PREMULTIPLIED); - check_texture (pipeline, material, 3, 0, /* position */ + check_texture (pipeline, 3, 0, /* position */ tex, 0x80008080); /* expected */ @@ -211,7 +191,7 @@ test_premult (void) tex = make_texture (0x80008080, COGL_PIXEL_FORMAT_RGBA_8888_PRE, /* src format */ TEXTURE_FLAG_SET_UNPREMULTIPLIED); - check_texture (pipeline, material, 4, 0, /* position */ + check_texture (pipeline, 4, 0, /* position */ tex, 0xff00ff80); /* expected */ @@ -225,7 +205,7 @@ test_premult (void) tex = make_texture (0x80008080, COGL_PIXEL_FORMAT_RGBA_8888_PRE, /* src format */ 0); /* default premultiplied status */ - check_texture (pipeline, material, 5, 0, /* position */ + check_texture (pipeline, 5, 0, /* position */ tex, 0x80008080); /* expected */ @@ -242,7 +222,7 @@ test_premult (void) if (cogl_test_verbose ()) g_print ("set_region (0xff00ff80, RGBA_8888)\n"); set_region (tex, 0xff00ff80, COGL_PIXEL_FORMAT_RGBA_8888); - check_texture (pipeline, material, 6, 0, /* position */ + check_texture (pipeline, 6, 0, /* position */ tex, 0xff00ff80); /* expected */ @@ -258,7 +238,7 @@ test_premult (void) if (cogl_test_verbose ()) g_print ("set_region (0x80008080, RGBA_8888_PRE)\n"); set_region (tex, 0x80008080, COGL_PIXEL_FORMAT_RGBA_8888_PRE); - check_texture (pipeline, material, 7, 0, /* position */ + check_texture (pipeline, 7, 0, /* position */ tex, 0xff00ff80); /* expected */ @@ -273,7 +253,7 @@ test_premult (void) if (cogl_test_verbose ()) g_print ("set_region (0x80008080, RGBA_8888_PRE)\n"); set_region (tex, 0x80008080, COGL_PIXEL_FORMAT_RGBA_8888_PRE); - check_texture (pipeline, material, 8, 0, /* position */ + check_texture (pipeline, 8, 0, /* position */ tex, 0x80008080); /* expected */ @@ -291,7 +271,7 @@ test_premult (void) if (cogl_test_verbose ()) g_print ("set_region (0xff00ff80, RGBA_8888)\n"); set_region (tex, 0xff00ff80, COGL_PIXEL_FORMAT_RGBA_8888); - check_texture (pipeline, material, 9, 0, /* position */ + check_texture (pipeline, 9, 0, /* position */ tex, 0x80008080); /* expected */ |