fix background on computer ui

pull/1309/head
Comma Device 5 years ago
parent b497a01417
commit 6abbda1467
  1. 16
      selfdrive/ui/paint.cc

@ -876,12 +876,26 @@ static void ui_draw_blank(UIState *s) {
glClear(GL_STENCIL_BUFFER_BIT | GL_COLOR_BUFFER_BIT); 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) { 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) { if (s->vision_connected && s->active_app == cereal_UiLayoutState_App_home && s->status != STATUS_STOPPED) {
ui_draw_sidebar(s); ui_draw_sidebar(s);
ui_draw_vision(s); ui_draw_vision(s);
} else { } else {
ui_draw_blank(s);
if (!s->scene.uilayout_sidebarcollapsed) { if (!s->scene.uilayout_sidebarcollapsed) {
ui_draw_sidebar(s); ui_draw_sidebar(s);
} }

Loading…
Cancel
Save