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: 06acd76d6d
commatwo_master
Willem Melching 4 years ago committed by GitHub
parent 34678fb7fb
commit 9d4829523d
  1. 10
      selfdrive/ui/qt/maps/map.cc

@ -117,6 +117,10 @@ void MapWindow::initLayers() {
} }
void MapWindow::timerUpdate() { void MapWindow::timerUpdate() {
if (isVisible()) {
update();
}
loaded_once = loaded_once || m_map->isFullyLoaded(); loaded_once = loaded_once || m_map->isFullyLoaded();
if (!loaded_once) { if (!loaded_once) {
map_instructions->showError("Map loading"); map_instructions->showError("Map loading");
@ -219,11 +223,10 @@ void MapWindow::timerUpdate() {
map_instructions->showError("Waiting for GPS"); map_instructions->showError("Waiting for GPS");
} }
} }
update();
} }
void MapWindow::resizeGL(int w, int h) { void MapWindow::resizeGL(int w, int h) {
m_map->resize(size() / MAP_SCALE);
map_instructions->setFixedWidth(width()); map_instructions->setFixedWidth(width());
} }
@ -251,9 +254,6 @@ void MapWindow::initializeGL() {
void MapWindow::paintGL() { void MapWindow::paintGL() {
if (!isVisible()) return; if (!isVisible()) return;
m_map->resize(size() / MAP_SCALE);
m_map->setFramebufferObject(defaultFramebufferObject(), size());
m_map->render(); m_map->render();
} }

Loading…
Cancel
Save