cogl/tests/backface-culling: Stop testing legacy state

It's going away, so stop testing it.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/935
This commit is contained in:
Jonas Ådahl 2019-11-22 11:55:21 +01:00 committed by Georges Basile Stavracas Neto
parent 4b5abdc988
commit 7faf9f91db

View File

@ -38,13 +38,12 @@ validate_part (CoglFramebuffer *framebuffer,
shown ? 0xff0000ff : 0x000000ff); shown ? 0xff0000ff : 0x000000ff);
} }
/* We draw everything 16 times. The draw number is used as a bitmask /* We draw everything 8 times. The draw number is used as a bitmask
to test all of the combinations of enabling legacy state, both to test all of the combinations of enabling both winding orders and all four
winding orders and all four culling modes */ culling modes */
#define USE_LEGACY_STATE(draw_num) (((draw_num) & 0x01) >> 0) #define FRONT_WINDING(draw_num) (((draw_num) & 0x01) >> 1)
#define FRONT_WINDING(draw_num) (((draw_num) & 0x02) >> 1) #define CULL_FACE_MODE(draw_num) (((draw_num) & 0x06) >> 2)
#define CULL_FACE_MODE(draw_num) (((draw_num) & 0x0c) >> 2)
static void static void
paint_test_backface_culling (TestState *state, paint_test_backface_culling (TestState *state,
@ -85,7 +84,6 @@ paint_test_backface_culling (TestState *state,
pipeline = cogl_pipeline_copy (base_pipeline); pipeline = cogl_pipeline_copy (base_pipeline);
cogl_set_backface_culling_enabled (USE_LEGACY_STATE (draw_num));
cogl_pipeline_set_front_face_winding (pipeline, FRONT_WINDING (draw_num)); cogl_pipeline_set_front_face_winding (pipeline, FRONT_WINDING (draw_num));
cogl_pipeline_set_cull_face_mode (pipeline, CULL_FACE_MODE (draw_num)); cogl_pipeline_set_cull_face_mode (pipeline, CULL_FACE_MODE (draw_num));
@ -163,14 +161,11 @@ validate_result (CoglFramebuffer *framebuffer, int y_offset)
{ {
int draw_num; int draw_num;
for (draw_num = 0; draw_num < 16; draw_num++) for (draw_num = 0; draw_num < 8; draw_num++)
{ {
gboolean cull_front, cull_back; gboolean cull_front, cull_back;
CoglPipelineCullFaceMode cull_mode; CoglPipelineCullFaceMode cull_mode;
if (USE_LEGACY_STATE (draw_num))
cull_mode = COGL_PIPELINE_CULL_FACE_MODE_BACK;
else
cull_mode = CULL_FACE_MODE (draw_num); cull_mode = CULL_FACE_MODE (draw_num);
switch (cull_mode) switch (cull_mode)
@ -242,13 +237,13 @@ paint (TestState *state)
cogl_pipeline_set_layer_texture (pipeline, 0, state->offscreen_tex); cogl_pipeline_set_layer_texture (pipeline, 0, state->offscreen_tex);
cogl_framebuffer_draw_rectangle (test_fb, cogl_framebuffer_draw_rectangle (test_fb,
pipeline, pipeline,
0, TEXTURE_RENDER_SIZE * 16, 0, TEXTURE_RENDER_SIZE * 8,
state->width, state->width,
state->height + TEXTURE_RENDER_SIZE * 16); state->height + TEXTURE_RENDER_SIZE * 8);
cogl_object_unref (pipeline); cogl_object_unref (pipeline);
validate_result (test_fb, 0); validate_result (test_fb, 0);
validate_result (test_fb, 16); validate_result (test_fb, 8);
} }
static CoglTexture * static CoglTexture *