From d5e9c7ecf19c73af6f3a9c2f03252b0faa2703a0 Mon Sep 17 00:00:00 2001 From: Dean Lee Date: Thu, 16 Dec 2021 03:13:50 +0800 Subject: [PATCH] UI: always clear CameraView background (#23231) * fix background * gate that with Hardware::EON * always call glclear old-commit-hash: 5810583d573af004120e6339a5597bf39cd6d331 --- selfdrive/ui/qt/widgets/cameraview.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/selfdrive/ui/qt/widgets/cameraview.cc b/selfdrive/ui/qt/widgets/cameraview.cc index a238f13c8..ff9f7754d 100644 --- a/selfdrive/ui/qt/widgets/cameraview.cc +++ b/selfdrive/ui/qt/widgets/cameraview.cc @@ -199,11 +199,10 @@ void CameraViewWidget::updateFrameMat(int w, int h) { } void CameraViewWidget::paintGL() { - if (latest_texture_id == -1) { - glClearColor(bg.redF(), bg.greenF(), bg.blueF(), bg.alphaF()); - glClear(GL_STENCIL_BUFFER_BIT | GL_COLOR_BUFFER_BIT); - return; - } + glClearColor(bg.redF(), bg.greenF(), bg.blueF(), bg.alphaF()); + glClear(GL_STENCIL_BUFFER_BIT | GL_COLOR_BUFFER_BIT); + + if (latest_texture_id == -1) return; glViewport(0, 0, width(), height());