tests: extend output-damage to GL shadow framebuffer

Extend the existing output-damage test to test
blit_shadow_to_output() specifically. This function had problems
originally, so make sure they can't reappear.

The added quirk is explained in the test.

An additional check of the quirk in gl_renderer_output_create() ensures
that the shadow framebuffer is really used. The test could false-pass if
the shadow is not used.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
dev
Pekka Paalanen 4 years ago
parent a3b68c29f9
commit b1e56143c5
  1. 2
      include/libweston/libweston.h
  2. 11
      libweston/renderer-gl/gl-renderer.c
  3. 31
      tests/output-damage-test.c

@ -196,6 +196,8 @@ enum weston_hdcp_protection {
struct weston_testsuite_quirks {
/** Force GL-renderer to do a full upload of wl_shm buffers. */
bool gl_force_full_upload;
/** Ensure GL shadow fb is used, and always repaint it fully. */
bool gl_force_full_redraw_of_shadow_fb;
};
/** Weston test suite data that is given to compositor

@ -1750,7 +1750,10 @@ gl_renderer_repaint_output(struct weston_output *output,
if (shadow_exists(go)) {
/* Repaint into shadow. */
repaint_views(output, output_damage);
if (compositor->test_data.test_quirks.gl_force_full_redraw_of_shadow_fb)
repaint_views(output, &output->region);
else
repaint_views(output, output_damage);
glBindFramebuffer(GL_FRAMEBUFFER, 0);
glViewport(go->borders[GL_RENDERER_BORDER_LEFT].width,
@ -3316,10 +3319,13 @@ gl_renderer_output_create(struct weston_output *output,
{
struct gl_output_state *go;
struct gl_renderer *gr = get_renderer(output->compositor);
const struct weston_testsuite_quirks *quirks;
GLint internal_format;
bool ret;
int i;
quirks = &output->compositor->test_data.test_quirks;
go = zalloc(sizeof *go);
if (go == NULL)
return -1;
@ -3357,6 +3363,9 @@ gl_renderer_output_create(struct weston_output *output,
free(go);
return -1;
}
} else if (quirks->gl_force_full_redraw_of_shadow_fb) {
weston_log("ERROR: gl_force_full_redraw_of_shadow_fb quirk used but shadow fb was not enabled.\n");
abort();
}
output->renderer_state = go;

@ -38,6 +38,7 @@
.scale = s, \
.transform = WL_OUTPUT_TRANSFORM_ ## t, \
.transform_name = #t, \
.gl_shadow_fb = false, \
.meta.name = "pixman " #s " " #t, \
}, \
{ \
@ -45,7 +46,16 @@
.scale = s, \
.transform = WL_OUTPUT_TRANSFORM_ ## t, \
.transform_name = #t, \
.meta.name = "GL " #s " " #t, \
.gl_shadow_fb = false, \
.meta.name = "GL no-shadow " #s " " #t, \
}, \
{ \
.renderer = RENDERER_GL, \
.scale = s, \
.transform = WL_OUTPUT_TRANSFORM_ ## t, \
.transform_name = #t, \
.gl_shadow_fb = true, \
.meta.name = "GL shadow " #s " " #t, \
}
struct setup_args {
@ -54,6 +64,7 @@ struct setup_args {
int scale;
enum wl_output_transform transform;
const char *transform_name;
bool gl_shadow_fb;
};
static const struct setup_args my_setup_args[] = {
@ -118,6 +129,24 @@ fixture_setup(struct weston_test_harness *harness, const struct setup_args *arg)
*/
setup.test_quirks.gl_force_full_upload = true;
if (arg->gl_shadow_fb) {
/*
* A second case for GL-renderer: the shadow framebuffer
*
* This tests blit_shadow_to_output() specifically. The quirk
* forces the shadow framebuffer to be redrawn completely, which
* means the test surface will be completely filled with a new
* color regardless of damage. The blit uses damage too, and
* the damage pattern that is tested for needs to appear in
* that step.
*/
setup.test_quirks.gl_force_full_redraw_of_shadow_fb = true;
weston_ini_setup(&setup,
cfgln("[output]"),
cfgln("name=headless"),
cfgln("use-renderer-shadow=true"));
}
return weston_test_harness_execute_as_client(harness, &setup);
}
DECLARE_FIXTURE_SETUP_WITH_ARG(fixture_setup, my_setup_args, meta);

Loading…
Cancel
Save