From 9d4829523d55db08eb87f60edee45479e7859aa5 Mon Sep 17 00:00:00 2001 From: Willem Melching Date: Fri, 2 Jul 2021 15:19:33 +0200 Subject: [PATCH] nav: don't set FBO, render when not loaded and resize once (#21468) * nav: don't set FBO and resize once * always update * when visible old-commit-hash: 06acd76d6d9583429b1c0977a6d18586997e3623 --- selfdrive/ui/qt/maps/map.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/selfdrive/ui/qt/maps/map.cc b/selfdrive/ui/qt/maps/map.cc index f09c493242..680e39a90b 100644 --- a/selfdrive/ui/qt/maps/map.cc +++ b/selfdrive/ui/qt/maps/map.cc @@ -117,6 +117,10 @@ void MapWindow::initLayers() { } void MapWindow::timerUpdate() { + if (isVisible()) { + update(); + } + loaded_once = loaded_once || m_map->isFullyLoaded(); if (!loaded_once) { map_instructions->showError("Map loading"); @@ -219,11 +223,10 @@ void MapWindow::timerUpdate() { map_instructions->showError("Waiting for GPS"); } } - - update(); } void MapWindow::resizeGL(int w, int h) { + m_map->resize(size() / MAP_SCALE); map_instructions->setFixedWidth(width()); } @@ -251,9 +254,6 @@ void MapWindow::initializeGL() { void MapWindow::paintGL() { if (!isVisible()) return; - - m_map->resize(size() / MAP_SCALE); - m_map->setFramebufferObject(defaultFramebufferObject(), size()); m_map->render(); }