    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
    glTexImage2D(GL_TEXTURE_2D, 0, GL_RG8, stream_width/2, stream_height/2, 0, GL_RG, GL_UNSIGNED_BYTE, nullptr);
    assert(glGetError() == GL_NO_ERROR);
  #endif
  
    updateFrameMat();
  }
  
  void CameraWidget::vipcFrameReceived() {
    update();
  }
 
</s> remove   if (frame) glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, stream_width/2, stream_height/2, GL_RG, GL_UNSIGNED_BYTE, frame->uv);
 </s> add   glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, stream_width/2, stream_height/2, GL_RG, GL_UNSIGNED_BYTE, frame->uv); </s> remove   if (frame) glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, stream_width, stream_height, GL_RED, GL_UNSIGNED_BYTE, frame->y);
 </s> add   glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, stream_width, stream_height, GL_RED, GL_UNSIGNED_BYTE, frame->y); </s> remove   updateFrameMat();
 </s> add  </s> remove   void hideEvent(QHideEvent *event) override;
 </s> add  </s> remove   VisionStreamType cur_stream_type = stream_type;
 </s> add   VisionStreamType cur_stream = requested_stream_type;
    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
    glTexImage2D(GL_TEXTURE_2D, 0, GL_RG8, stream_width/2, stream_height/2, 0, GL_RG, GL_UNSIGNED_BYTE, nullptr);
    assert(glGetError() == GL_NO_ERROR);
  #endif


  }
  
  void CameraWidget::vipcFrameReceived() {
    update();
  }
keep keep keep keep replace replace keep keep keep keep keep
 UI: draw onroad objects on right frame (#26306)

* update before draw

* fix a lot of janky

* fix more flicker

* cleanup

* fix flicker when opening settings

* simplify 
selfdrive/ui/qt/widgets/cameraview.cc