From 6abbda14671bf3fdc1d52cfc0a1337f8ca43331f Mon Sep 17 00:00:00 2001 From: Comma Device Date: Wed, 1 Apr 2020 23:01:05 +0000 Subject: [PATCH] fix background on computer ui --- selfdrive/ui/paint.cc | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/selfdrive/ui/paint.cc b/selfdrive/ui/paint.cc index 65d7278499..379115431c 100644 --- a/selfdrive/ui/paint.cc +++ b/selfdrive/ui/paint.cc @@ -876,12 +876,26 @@ static void ui_draw_blank(UIState *s) { glClear(GL_STENCIL_BUFFER_BIT | GL_COLOR_BUFFER_BIT); } +static void ui_draw_background(UIState *s) { + int bg_status = s->status; + assert(bg_status < ARRAYSIZE(bg_colors)); + const uint8_t *color = bg_colors[bg_status]; + + glClearColor(color[0]/256.0, color[1]/256.0, color[2]/256.0, 1.0); + glClear(GL_STENCIL_BUFFER_BIT | GL_COLOR_BUFFER_BIT); +} + void ui_draw(UIState *s) { +#ifdef QCOM + // TODO: once offroad can become transparent, we can remove bg_thread and this + ui_draw_blank(s); +#else + ui_draw_background(s); +#endif if (s->vision_connected && s->active_app == cereal_UiLayoutState_App_home && s->status != STATUS_STOPPED) { ui_draw_sidebar(s); ui_draw_vision(s); } else { - ui_draw_blank(s); if (!s->scene.uilayout_sidebarcollapsed) { ui_draw_sidebar(s); }