    glUniform1i(program->uniformLocation("uTextureV"), 2);
  }
  
  void CameraViewWidget::showEvent(QShowEvent *event) {
    latest_texture_id = -1;
    if (!vipc_thread) {
      vipc_thread = new QThread();
      connect(vipc_thread, &QThread::started, [=]() { vipcThread(); });
      connect(vipc_thread, &QThread::finished, vipc_thread, &QObject::deleteLater);
      vipc_thread->start();
 
</s> remove   std::unique_ptr<QOpenGLContext> ctx;
  std::unique_ptr<QOffscreenSurface> surface;
  std::unique_ptr<QOpenGLBuffer> gl_buffer;

  ctx = std::make_unique<QOpenGLContext>();
  ctx->setFormat(context()->format());
  ctx->setShareContext(context());
  ctx->create();
  assert(ctx->isValid());

  surface = std::make_unique<QOffscreenSurface>();
  surface->setFormat(ctx->format());
  surface->create();
  ctx->makeCurrent(surface.get());
  assert(QOpenGLContext::currentContext() == ctx.get());
  initializeOpenGLFunctions();

 </s> add  </s> remove   int latest_texture_id = -1;
 </s> add   VisionBuf *latest_frame = nullptr; </s> remove   "./_ui": 33.0,
 </s> add   "./_ui": 18.4,
  latest_frame = nullptr;
    glUniform1i(program->uniformLocation("uTextureV"), 2);
  }
  
  void CameraViewWidget::showEvent(QShowEvent *event) {
  latest_frame = nullptr;
    if (!vipc_thread) {
      vipc_thread = new QThread();
      connect(vipc_thread, &QThread::started, [=]() { vipcThread(); });
      connect(vipc_thread, &QThread::finished, vipc_thread, &QObject::deleteLater);
      vipc_thread->start();
keep keep keep keep replace keep keep keep keep keep
 UI: remove memcpy on frame receive (#24318)

* UI: remove frame memcpy

* fix freezing

* fix onroad test 
selfdrive/ui/qt/widgets/cameraview.cc