renderer-gl: Display a solid shader color when direct-display is in use
authorMarius Vlad <marius.vlad@collabora.com>
Tue, 12 Nov 2019 13:44:43 +0000 (15:44 +0200)
committerMarius Vlad <marius.vlad@collabora.com>
Thu, 21 Nov 2019 12:07:54 +0000 (14:07 +0200)
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
libweston/renderer-gl/gl-renderer.c

index 35b278d425c01a2faaa33df50421d50212034bda..7c32fb3c0db3634ffcf0ff1ee2853a700af277a5 100644 (file)
@@ -839,6 +839,15 @@ setup_censor_overrides(struct weston_output *output,
        bool unprotected_censor =
                (ev->surface->desired_protection > output->current_protection);
 
+       if (gs->direct_display) {
+               gs->color[0] = 0.40;
+               gs->color[1] = 0.0;
+               gs->color[2] = 0.0;
+               gs->color[3] = 1.0;
+               gs->shader = &gr->solid_shader;
+               return gs->shader;
+       }
+
        /* When not in enforced mode, the client is notified of the protection */
        /* change, so content censoring is not required */
        if (ev->surface->protection_mode !=
@@ -877,7 +886,7 @@ draw_view(struct weston_view *ev, struct weston_output *output,
        /* In case of a runtime switch of renderers, we may not have received
         * an attach for this surface since the switch. In that case we don't
         * have a valid buffer or a proper shader set up so skip rendering. */
-       if (!gs->shader)
+       if (!gs->shader && !gs->direct_display)
                return;
 
        pixman_region32_init(&repaint);