diff options
Diffstat (limited to 'tests/conform/test-sparse-pipeline.c')
-rw-r--r-- | tests/conform/test-sparse-pipeline.c | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/tests/conform/test-sparse-pipeline.c b/tests/conform/test-sparse-pipeline.c index b6848b4a..a88f50b5 100644 --- a/tests/conform/test-sparse-pipeline.c +++ b/tests/conform/test-sparse-pipeline.c @@ -5,10 +5,8 @@ typedef struct _TestState { - CoglContext *ctx; int fb_width; int fb_height; - CoglFramebuffer *fb; } TestState; static void @@ -17,17 +15,17 @@ test_sparse_layer_combine (TestState *state) CoglPipeline *pipeline; CoglTexture *tex1, *tex2; - cogl_framebuffer_clear4f (state->fb, COGL_BUFFER_BIT_COLOR, 0, 0, 0, 1); + cogl_framebuffer_clear4f (fb, COGL_BUFFER_BIT_COLOR, 0, 0, 0, 1); /* This tests that the TEXTURE_* numbers used in the layer combine string refer to the layer number rather than the unit numbers by creating a pipeline with very large layer numbers. This should end up being mapped to much smaller unit numbers */ - tex1 = test_utils_create_color_texture (state->ctx, 0xff0000ff); - tex2 = test_utils_create_color_texture (state->ctx, 0x00ff00ff); + tex1 = test_utils_create_color_texture (ctx, 0xff0000ff); + tex2 = test_utils_create_color_texture (ctx, 0x00ff00ff); - pipeline = cogl_pipeline_new (state->ctx); + pipeline = cogl_pipeline_new (ctx); cogl_pipeline_set_layer_texture (pipeline, 50, tex1); cogl_pipeline_set_layer_texture (pipeline, 100, tex2); @@ -35,11 +33,9 @@ test_sparse_layer_combine (TestState *state) "RGBA = ADD(TEXTURE_50, TEXTURE_100)", NULL); - cogl_push_source (pipeline); - cogl_rectangle (-1, -1, 1, 1); - cogl_pop_source (); + cogl_framebuffer_draw_rectangle (fb, pipeline, -1, -1, 1, 1); - test_utils_check_pixel (2, 2, 0xffff00ff); + test_utils_check_pixel (fb, 2, 2, 0xffff00ff); cogl_object_unref (pipeline); cogl_object_unref (tex1); @@ -47,16 +43,12 @@ test_sparse_layer_combine (TestState *state) } void -test_cogl_sparse_pipeline (TestUtilsGTestFixture *fixture, - void *data) +test_sparse_pipeline (void) { - TestUtilsSharedState *shared_state = data; TestState state; - state.ctx = shared_state->ctx; - state.fb_width = cogl_framebuffer_get_width (shared_state->fb); - state.fb_height = cogl_framebuffer_get_height (shared_state->fb); - state.fb = shared_state->fb; + state.fb_width = cogl_framebuffer_get_width (fb); + state.fb_height = cogl_framebuffer_get_height (fb); test_sparse_layer_combine (&state); |