diff --git a/frontend/main.c b/frontend/main.c index 22065b08e..802b4a19b 100644 --- a/frontend/main.c +++ b/frontend/main.c @@ -1216,6 +1216,9 @@ weston_compositor_init_config(struct weston_compositor *ec, weston_log("Output repaint window is %d ms maximum.\n", ec->repaint_msec); + weston_config_section_get_uint(s, "placeholder-color", + &ec->placeholder_color, 0x660000); + weston_config_section_get_bool(s, "color-management", &color_management, false); if (color_management) { diff --git a/include/libweston/libweston.h b/include/libweston/libweston.h index 193dcdaa4..9d9e860d1 100644 --- a/include/libweston/libweston.h +++ b/include/libweston/libweston.h @@ -1421,6 +1421,10 @@ struct weston_compositor { /** fires with frame_counter_interval rate */ struct wl_event_source *frame_counter_timer; } perf_surface_stats; + + /* if set use this placeholder-color to use instead of the default + * grenadier one */ + uint32_t placeholder_color; }; struct weston_solid_buffer_values { diff --git a/libweston/compositor.c b/libweston/compositor.c index 399a632f7..08216803d 100644 --- a/libweston/compositor.c +++ b/libweston/compositor.c @@ -214,9 +214,13 @@ maybe_replace_paint_node(struct weston_paint_node *pnode) (surface->desired_protection > WESTON_HDCP_DISABLE); bool unprotected_censor = (surface->desired_protection > output->current_protection); - struct weston_solid_buffer_values placeholder_color = { - 0.40f, 0.0f, 0.0f, 1.0f - }; + struct weston_solid_buffer_values placeholder_color; + uint32_t color_tmp = output->compositor->placeholder_color; + + placeholder_color.r = ((color_tmp >> 16) & 0xff) / 255.0; + placeholder_color.g = ((color_tmp >> 8) & 0xff) / 255.0; + placeholder_color.b = ((color_tmp >> 0) & 0xff) / 255.0; + placeholder_color.a = 1.0; pnode->draw_solid = false; pnode->is_direct = false; diff --git a/man/weston.ini.man b/man/weston.ini.man index 305004f87..f35b42673 100644 --- a/man/weston.ini.man +++ b/man/weston.ini.man @@ -249,6 +249,12 @@ Boolean, defaults to .BR false . These decorations cannot normally be screenshot. This option is useful for the Weston test suite only. +.TP 7 +.BI "placeholder-color=" 0xRRGGBB +sets the color of the placeholder (unsigned integer). The hexadecimal digit +pairs are in order red, green, and blue. This placeholder is used for +content-protection or when we're not able to lift a surface/view in a HW plane, +but we require direct scan-out of buffers. Defaults to 0x660000 (red grenadier). .\"--------------------------------------------------------------------- .SH "LIBINPUT SECTION" The