void test_wrap_rectangle_textures (void) { float fb_width = cogl_framebuffer_get_width (test_fb); float fb_height = cogl_framebuffer_get_height (test_fb); CoglPipeline *base_pipeline; CoglPipeline *clamp_pipeline; CoglPipeline *repeat_pipeline; /* The textures are drawn with the texture coordinates from * -0.5→1.5. That means we get one complete copy of the texture and * an extra half of the texture surrounding it. The drawing is * tested against a 4x4 grid of colors. The center 2x2 colours * specify the normal texture colors and the other colours specify * what the wrap mode should generate */ static const uint8_t clamp_colors[] = { 0x44, 0x44, 0x88, 0x88, 0x44, 0x44, 0x88, 0x88, 0xcc, 0xcc, 0xff, 0xff, 0xcc, 0xcc, 0xff, 0xff }; static const uint8_t repeat_colors[] = { 0xff, 0xcc, 0xff, 0xcc, 0x88, 0x44, 0x88, 0x44, 0xff, 0xcc, 0xff, 0xcc, 0x88, 0x44, 0x88, 0x44 }; cogl_framebuffer_orthographic (test_fb, 0, 0, /* x_1, y_1 */ fb_width, /* x_2 */ fb_height /* y_2 */, -1, 100 /* near/far */); base_pipeline = create_base_pipeline (); clamp_pipeline = cogl_pipeline_copy (base_pipeline); cogl_pipeline_set_layer_wrap_mode (clamp_pipeline, 0, /* layer */ COGL_PIPELINE_WRAP_MODE_CLAMP_TO_EDGE); repeat_pipeline = cogl_pipeline_copy (base_pipeline); cogl_pipeline_set_layer_wrap_mode (repeat_pipeline, 0, /* layer */ COGL_PIPELINE_WRAP_MODE_REPEAT); test_pipeline (clamp_pipeline, 0, 0, /* x/y offset */ clamp_colors); test_pipeline (repeat_pipeline, 0, DRAW_SIZE * 2, /* x/y offset */ repeat_colors); cogl_object_unref (repeat_pipeline); cogl_object_unref (clamp_pipeline); cogl_object_unref (base_pipeline); }
void test_pipelines() { gint quality; xmlfile = "test_pipelines"; std_log(LOG_FILENAME_LINE, "Test Started test_pipelines"); /* Test qualities 0, 5 and 10 */ for (quality = 0; quality < 11; quality += 5) { test_pipeline (8, FALSE, 44100, 48000, quality); test_pipeline (8, FALSE, 48000, 44100, quality); test_pipeline (16, FALSE, 44100, 48000, quality); test_pipeline (16, FALSE, 48000, 44100, quality); test_pipeline (24, FALSE, 44100, 48000, quality); test_pipeline (24, FALSE, 48000, 44100, quality); test_pipeline (32, FALSE, 44100, 48000, quality); test_pipeline (32, FALSE, 48000, 44100, quality); test_pipeline (32, TRUE, 44100, 48000, quality); test_pipeline (32, TRUE, 48000, 44100, quality); test_pipeline (64, TRUE, 44100, 48000, quality); test_pipeline (64, TRUE, 48000, 44100, quality); } std_log(LOG_FILENAME_LINE, "Test Successful"); create_xml(0); }