compositor: add weston.ini option use-renderer-shadow
This adds an output section option use-renderer-shadow in weston.ini. This option is only recognized with headless and DRM backends, because it requires GL-renderer and does not support resizing outputs. The option is called use-renderer-shadow because this is what it does right now. In the future the same setting will be used to turn on more complex image processing when operational pieces required for color management land. Once color management is implemented, this option is expected to be removed. This option allows developer testing of features to be used to implement color management. This is a rewrite of "weston.ini: introduce use-shadow-fbo in output config" by Harish Krupo. The main.c code is structured differently, the weston.ini option is renamed, and the man page paragraph is moved to weston.ini.man with different content. Cc: Harish Krupo <harishkrupo@gmail.com> Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This commit is contained in:
@@ -1251,6 +1251,29 @@ wet_output_set_transform(struct weston_output *output,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
wet_output_set_renderer_shadow(struct weston_output *output,
|
||||
struct weston_config_section *section)
|
||||
{
|
||||
bool use_shadow = false;
|
||||
|
||||
if (section) {
|
||||
weston_config_section_get_bool(section,
|
||||
"use-renderer-shadow",
|
||||
&use_shadow, false);
|
||||
}
|
||||
|
||||
if (use_shadow) {
|
||||
if (!weston_output_set_renderer_shadow_buffer(output)) {
|
||||
weston_log("Output \"%s\" does not support use-renderer-shadow.\n",
|
||||
output->name);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
allow_content_protection(struct weston_output *output,
|
||||
struct weston_config_section *section)
|
||||
@@ -1768,6 +1791,9 @@ drm_backend_output_configure(struct weston_output *output,
|
||||
|
||||
allow_content_protection(output, section);
|
||||
|
||||
if (wet_output_set_renderer_shadow(output, section) < 0)
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2578,6 +2604,12 @@ headless_backend_output_configure(struct weston_output *output)
|
||||
.scale = 1,
|
||||
.transform = WL_OUTPUT_TRANSFORM_NORMAL
|
||||
};
|
||||
struct weston_config *wc = wet_get_config(output->compositor);
|
||||
struct weston_config_section *section;
|
||||
|
||||
section = weston_config_get_section(wc, "output", "name", output->name);
|
||||
if (wet_output_set_renderer_shadow(output, section) < 0)
|
||||
return -1;
|
||||
|
||||
return wet_configure_windowed_output_from_config(output, &defaults);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user