tests: use enum weston_renderer_type

Now that enum weston_renderer_type is public, there is no need for a
local enum renderer_type in the tests.

Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
This commit is contained in:
Philipp Zabel 2022-12-05 17:05:21 +01:00 committed by Philipp Zabel
parent 35b3cb83b0
commit e3b64b6e76
19 changed files with 44 additions and 58 deletions

View File

@ -36,7 +36,7 @@
struct setup_args { struct setup_args {
struct fixture_metadata meta; struct fixture_metadata meta;
enum renderer_type renderer; enum weston_renderer_type renderer;
bool color_management; bool color_management;
}; };
@ -45,17 +45,17 @@ static const int BLOCK_WIDTH = 3;
static const struct setup_args my_setup_args[] = { static const struct setup_args my_setup_args[] = {
{ {
.renderer = RENDERER_PIXMAN, .renderer = WESTON_RENDERER_PIXMAN,
.color_management = false, .color_management = false,
.meta.name = "pixman" .meta.name = "pixman"
}, },
{ {
.renderer = RENDERER_GL, .renderer = WESTON_RENDERER_GL,
.color_management = false, .color_management = false,
.meta.name = "GL" .meta.name = "GL"
}, },
{ {
.renderer = RENDERER_GL, .renderer = WESTON_RENDERER_GL,
.color_management = true, .color_management = true,
.meta.name = "GL sRGB EOTF" .meta.name = "GL sRGB EOTF"
}, },

View File

@ -35,14 +35,14 @@
#define TRANSFORM(x) WL_OUTPUT_TRANSFORM_ ## x, #x #define TRANSFORM(x) WL_OUTPUT_TRANSFORM_ ## x, #x
#define RENDERERS(s, t) \ #define RENDERERS(s, t) \
{ \ { \
.renderer = RENDERER_PIXMAN, \ .renderer = WESTON_RENDERER_PIXMAN, \
.scale = s, \ .scale = s, \
.transform = WL_OUTPUT_TRANSFORM_ ## t, \ .transform = WL_OUTPUT_TRANSFORM_ ## t, \
.transform_name = #t, \ .transform_name = #t, \
.meta.name = "pixman " #s " " #t, \ .meta.name = "pixman " #s " " #t, \
}, \ }, \
{ \ { \
.renderer = RENDERER_GL, \ .renderer = WESTON_RENDERER_GL, \
.scale = s, \ .scale = s, \
.transform = WL_OUTPUT_TRANSFORM_ ## t, \ .transform = WL_OUTPUT_TRANSFORM_ ## t, \
.transform_name = #t, \ .transform_name = #t, \
@ -51,7 +51,7 @@
struct setup_args { struct setup_args {
struct fixture_metadata meta; struct fixture_metadata meta;
enum renderer_type renderer; enum weston_renderer_type renderer;
int scale; int scale;
enum wl_output_transform transform; enum wl_output_transform transform;
const char *transform_name; const char *transform_name;

View File

@ -438,7 +438,7 @@ fixture_setup(struct weston_test_harness *harness, const struct setup_args *arg)
cmsSetLogErrorHandler(test_lcms_error_logger); cmsSetLogErrorHandler(test_lcms_error_logger);
compositor_setup_defaults(&setup); compositor_setup_defaults(&setup);
setup.renderer = RENDERER_GL; setup.renderer = WESTON_RENDERER_GL;
setup.backend = WESTON_BACKEND_HEADLESS; setup.backend = WESTON_BACKEND_HEADLESS;
setup.width = WINDOW_WIDTH; setup.width = WINDOW_WIDTH;
setup.height = WINDOW_HEIGHT; setup.height = WINDOW_HEIGHT;

View File

@ -34,7 +34,7 @@ fixture_setup(struct weston_test_harness *harness)
struct compositor_setup setup; struct compositor_setup setup;
compositor_setup_defaults(&setup); compositor_setup_defaults(&setup);
setup.renderer = RENDERER_GL; setup.renderer = WESTON_RENDERER_GL;
setup.shell = SHELL_TEST_DESKTOP; setup.shell = SHELL_TEST_DESKTOP;
weston_ini_setup(&setup, weston_ini_setup(&setup,

View File

@ -38,7 +38,7 @@ fixture_setup(struct weston_test_harness *harness)
struct compositor_setup setup; struct compositor_setup setup;
compositor_setup_defaults(&setup); compositor_setup_defaults(&setup);
setup.renderer = RENDERER_GL; setup.renderer = WESTON_RENDERER_GL;
setup.shell = SHELL_TEST_DESKTOP; setup.shell = SHELL_TEST_DESKTOP;
weston_ini_setup(&setup, weston_ini_setup(&setup,

View File

@ -36,7 +36,7 @@ fixture_setup(struct weston_test_harness *harness)
compositor_setup_defaults(&setup); compositor_setup_defaults(&setup);
setup.shell = SHELL_TEST_DESKTOP; setup.shell = SHELL_TEST_DESKTOP;
setup.backend = WESTON_BACKEND_DRM; setup.backend = WESTON_BACKEND_DRM;
setup.renderer = RENDERER_PIXMAN; setup.renderer = WESTON_RENDERER_PIXMAN;
return weston_test_harness_execute_as_client(harness, &setup); return weston_test_harness_execute_as_client(harness, &setup);
} }

View File

@ -39,7 +39,7 @@ fixture_setup(struct weston_test_harness *harness)
struct compositor_setup setup; struct compositor_setup setup;
compositor_setup_defaults(&setup); compositor_setup_defaults(&setup);
setup.renderer = RENDERER_PIXMAN; setup.renderer = WESTON_RENDERER_PIXMAN;
setup.width = 320; setup.width = 320;
setup.height = 240; setup.height = 240;
setup.shell = SHELL_DESKTOP; setup.shell = SHELL_DESKTOP;

View File

@ -45,7 +45,7 @@ fixture_setup(struct weston_test_harness *harness)
/* We need to use the pixman renderer, since a few of the tests depend /* We need to use the pixman renderer, since a few of the tests depend
* on the renderer holding onto a surface buffer until the next one * on the renderer holding onto a surface buffer until the next one
* is committed, which the noop renderer doesn't do. */ * is committed, which the noop renderer doesn't do. */
setup.renderer = RENDERER_PIXMAN; setup.renderer = WESTON_RENDERER_PIXMAN;
return weston_test_harness_execute_as_client(harness, &setup); return weston_test_harness_execute_as_client(harness, &setup);
} }

View File

@ -33,19 +33,19 @@
struct setup_args { struct setup_args {
struct fixture_metadata meta; struct fixture_metadata meta;
enum renderer_type renderer; enum weston_renderer_type renderer;
uint32_t expected_drm_format; uint32_t expected_drm_format;
}; };
static const struct setup_args my_setup_args[] = { static const struct setup_args my_setup_args[] = {
{ {
.meta.name = "pixman", .meta.name = "pixman",
.renderer = RENDERER_PIXMAN, .renderer = WESTON_RENDERER_PIXMAN,
.expected_drm_format = DRM_FORMAT_XRGB8888, .expected_drm_format = DRM_FORMAT_XRGB8888,
}, },
{ {
.meta.name = "GL", .meta.name = "GL",
.renderer = RENDERER_GL, .renderer = WESTON_RENDERER_GL,
.expected_drm_format = DRM_FORMAT_ARGB8888, .expected_drm_format = DRM_FORMAT_ARGB8888,
}, },
}; };

View File

@ -34,7 +34,7 @@
#define RENDERERS(s, t) \ #define RENDERERS(s, t) \
{ \ { \
.renderer = RENDERER_PIXMAN, \ .renderer = WESTON_RENDERER_PIXMAN, \
.scale = s, \ .scale = s, \
.transform = WL_OUTPUT_TRANSFORM_ ## t, \ .transform = WL_OUTPUT_TRANSFORM_ ## t, \
.transform_name = #t, \ .transform_name = #t, \
@ -42,7 +42,7 @@
.meta.name = "pixman " #s " " #t, \ .meta.name = "pixman " #s " " #t, \
}, \ }, \
{ \ { \
.renderer = RENDERER_GL, \ .renderer = WESTON_RENDERER_GL, \
.scale = s, \ .scale = s, \
.transform = WL_OUTPUT_TRANSFORM_ ## t, \ .transform = WL_OUTPUT_TRANSFORM_ ## t, \
.transform_name = #t, \ .transform_name = #t, \
@ -50,7 +50,7 @@
.meta.name = "GL no-shadow " #s " " #t, \ .meta.name = "GL no-shadow " #s " " #t, \
}, \ }, \
{ \ { \
.renderer = RENDERER_GL, \ .renderer = WESTON_RENDERER_GL, \
.scale = s, \ .scale = s, \
.transform = WL_OUTPUT_TRANSFORM_ ## t, \ .transform = WL_OUTPUT_TRANSFORM_ ## t, \
.transform_name = #t, \ .transform_name = #t, \
@ -60,7 +60,7 @@
struct setup_args { struct setup_args {
struct fixture_metadata meta; struct fixture_metadata meta;
enum renderer_type renderer; enum weston_renderer_type renderer;
int scale; int scale;
enum wl_output_transform transform; enum wl_output_transform transform;
const char *transform_name; const char *transform_name;

View File

@ -34,7 +34,7 @@ fixture_setup(struct weston_test_harness *harness)
struct compositor_setup setup; struct compositor_setup setup;
compositor_setup_defaults(&setup); compositor_setup_defaults(&setup);
setup.renderer = RENDERER_GL; setup.renderer = WESTON_RENDERER_GL;
setup.width = 300; setup.width = 300;
setup.height = 150; setup.height = 150;
setup.shell = SHELL_TEST_DESKTOP; setup.shell = SHELL_TEST_DESKTOP;

View File

@ -35,14 +35,14 @@
#define TRANSFORM(x) WL_OUTPUT_TRANSFORM_ ## x, #x #define TRANSFORM(x) WL_OUTPUT_TRANSFORM_ ## x, #x
#define RENDERERS(s, t) \ #define RENDERERS(s, t) \
{ \ { \
.renderer = RENDERER_PIXMAN, \ .renderer = WESTON_RENDERER_PIXMAN, \
.scale = s, \ .scale = s, \
.transform = WL_OUTPUT_TRANSFORM_ ## t, \ .transform = WL_OUTPUT_TRANSFORM_ ## t, \
.transform_name = #t, \ .transform_name = #t, \
.meta.name = "pixman " #s " " #t, \ .meta.name = "pixman " #s " " #t, \
}, \ }, \
{ \ { \
.renderer = RENDERER_GL, \ .renderer = WESTON_RENDERER_GL, \
.scale = s, \ .scale = s, \
.transform = WL_OUTPUT_TRANSFORM_ ## t, \ .transform = WL_OUTPUT_TRANSFORM_ ## t, \
.transform_name = #t, \ .transform_name = #t, \
@ -51,7 +51,7 @@
struct setup_args { struct setup_args {
struct fixture_metadata meta; struct fixture_metadata meta;
enum renderer_type renderer; enum weston_renderer_type renderer;
int scale; int scale;
enum wl_output_transform transform; enum wl_output_transform transform;
const char *transform_name; const char *transform_name;

View File

@ -35,16 +35,16 @@
struct setup_args { struct setup_args {
struct fixture_metadata meta; struct fixture_metadata meta;
enum renderer_type renderer; enum weston_renderer_type renderer;
}; };
static const struct setup_args my_setup_args[] = { static const struct setup_args my_setup_args[] = {
{ {
.renderer = RENDERER_PIXMAN, .renderer = WESTON_RENDERER_PIXMAN,
.meta.name = "pixman" .meta.name = "pixman"
}, },
{ {
.renderer = RENDERER_GL, .renderer = WESTON_RENDERER_GL,
.meta.name = "GL" .meta.name = "GL"
}, },
}; };

View File

@ -39,16 +39,16 @@
struct setup_args { struct setup_args {
struct fixture_metadata meta; struct fixture_metadata meta;
enum renderer_type renderer; enum weston_renderer_type renderer;
}; };
static const struct setup_args my_setup_args[] = { static const struct setup_args my_setup_args[] = {
{ {
.renderer = RENDERER_PIXMAN, .renderer = WESTON_RENDERER_PIXMAN,
.meta.name = "pixman" .meta.name = "pixman"
}, },
{ {
.renderer = RENDERER_GL, .renderer = WESTON_RENDERER_GL,
.meta.name = "GL" .meta.name = "GL"
}, },
}; };

View File

@ -35,16 +35,16 @@
struct setup_args { struct setup_args {
struct fixture_metadata meta; struct fixture_metadata meta;
enum renderer_type renderer; enum weston_renderer_type renderer;
}; };
static const struct setup_args my_setup_args[] = { static const struct setup_args my_setup_args[] = {
{ {
.renderer = RENDERER_PIXMAN, .renderer = WESTON_RENDERER_PIXMAN,
.meta.name = "pixman" .meta.name = "pixman"
}, },
{ {
.renderer = RENDERER_GL, .renderer = WESTON_RENDERER_GL,
.meta.name = "GL" .meta.name = "GL"
}, },
}; };

View File

@ -35,16 +35,16 @@
struct setup_args { struct setup_args {
struct fixture_metadata meta; struct fixture_metadata meta;
enum renderer_type renderer; enum weston_renderer_type renderer;
}; };
static const struct setup_args my_setup_args[] = { static const struct setup_args my_setup_args[] = {
{ {
.renderer = RENDERER_PIXMAN, .renderer = WESTON_RENDERER_PIXMAN,
.meta.name = "pixman" .meta.name = "pixman"
}, },
{ {
.renderer = RENDERER_GL, .renderer = WESTON_RENDERER_GL,
.meta.name = "GL" .meta.name = "GL"
}, },
}; };

View File

@ -188,7 +188,7 @@ compositor_setup_defaults_(struct compositor_setup *setup,
*setup = (struct compositor_setup) { *setup = (struct compositor_setup) {
.test_quirks = (struct weston_testsuite_quirks){ }, .test_quirks = (struct weston_testsuite_quirks){ },
.backend = WESTON_BACKEND_HEADLESS, .backend = WESTON_BACKEND_HEADLESS,
.renderer = RENDERER_NOOP, .renderer = WESTON_RENDERER_NOOP,
.shell = SHELL_TEST_DESKTOP, .shell = SHELL_TEST_DESKTOP,
.xwayland = false, .xwayland = false,
.width = 320, .width = 320,
@ -218,12 +218,12 @@ backend_to_str(enum weston_compositor_backend b)
} }
static const char * static const char *
renderer_to_str(enum renderer_type t) renderer_to_str(enum weston_renderer_type t)
{ {
static const char * const names[] = { static const char * const names[] = {
[RENDERER_NOOP] = "noop", [WESTON_RENDERER_NOOP] = "noop",
[RENDERER_PIXMAN] = "pixman", [WESTON_RENDERER_PIXMAN] = "pixman",
[RENDERER_GL] = "gl", [WESTON_RENDERER_GL] = "gl",
}; };
assert(t >= 0 && t <= ARRAY_LENGTH(names)); assert(t >= 0 && t <= ARRAY_LENGTH(names));
return names[t]; return names[t];
@ -405,7 +405,7 @@ execute_compositor(const struct compositor_setup *setup,
#endif #endif
#ifndef ENABLE_EGL #ifndef ENABLE_EGL
if (setup->renderer == RENDERER_GL) { if (setup->renderer == WESTON_RENDERER_GL) {
fprintf(stderr, "GL-renderer required but not built, skipping.\n"); fprintf(stderr, "GL-renderer required but not built, skipping.\n");
ret = RESULT_SKIP; ret = RESULT_SKIP;
} }

View File

@ -31,20 +31,6 @@
#include "weston-testsuite-data.h" #include "weston-testsuite-data.h"
/** Weston renderer type
*
* \sa compositor_setup
* \ingroup testharness
*/
enum renderer_type {
/** Dummy renderer that does nothing. */
RENDERER_NOOP = 0,
/** Pixman-renderer */
RENDERER_PIXMAN,
/** GL-renderer */
RENDERER_GL
};
/** Weston shell plugin /** Weston shell plugin
* *
* \sa compositor_setup * \sa compositor_setup
@ -76,7 +62,7 @@ struct compositor_setup {
/** The backend to use. */ /** The backend to use. */
enum weston_compositor_backend backend; enum weston_compositor_backend backend;
/** The renderer to use. */ /** The renderer to use. */
enum renderer_type renderer; enum weston_renderer_type renderer;
/** The shell plugin to use. */ /** The shell plugin to use. */
enum shell_type shell; enum shell_type shell;
/** Whether to enable xwayland support. */ /** Whether to enable xwayland support. */

View File

@ -44,7 +44,7 @@ fixture_setup(struct weston_test_harness *harness)
struct compositor_setup setup; struct compositor_setup setup;
compositor_setup_defaults(&setup); compositor_setup_defaults(&setup);
setup.renderer = RENDERER_GL; setup.renderer = WESTON_RENDERER_GL;
setup.width = 324; setup.width = 324;
setup.height = 264; setup.height = 264;
setup.shell = SHELL_TEST_DESKTOP; setup.shell = SHELL_TEST_DESKTOP;