Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cc278ff4 authored by Jim Shargo's avatar Jim Shargo
Browse files

BufferQueues: clean up ConsumerBase constructors

These currently use flags that muddy up client code. We've added nice
new *::create methods, so lets use those and clean
things up.

BYPASS_IGBP_IGBC_API_REASON=warren buffers

Bug: 398822412
Flag: EXEMPT refactor
Test: builds, presubmit
Change-Id: I57b5ad3e0214b4580d195eb451f707f3a3c912a6
parent 4da5a039
Loading
Loading
Loading
Loading
+3 −12
Original line number Diff line number Diff line
@@ -167,18 +167,9 @@ bool GLEnv::InitWithNewContext() {
  }

  // Create dummy surface using a GLConsumer
#if COM_ANDROID_GRAPHICS_LIBGUI_FLAGS(WB_CONSUMER_BASE_OWNS_BQ)
  surfaceTexture_ = new GLConsumer(0, GLConsumer::TEXTURE_EXTERNAL, /*useFenceSync=*/true,
  std::tie(surfaceTexture_, window_) =
          GLConsumer::create(0, GLConsumer::TEXTURE_EXTERNAL, /*useFenceSync=*/true,
                             /*isControlledByApp=*/false);
  window_ = surfaceTexture_->getSurface();
#else
  sp<IGraphicBufferProducer> producer;
  sp<IGraphicBufferConsumer> consumer;
  BufferQueue::createBufferQueue(&producer, &consumer);
  surfaceTexture_ = new GLConsumer(consumer, 0, GLConsumer::TEXTURE_EXTERNAL,
          true, false);
  window_ = new Surface(producer);
#endif // COM_ANDROID_GRAPHICS_LIBGUI_FLAGS(WB_CONSUMER_BASE_OWNS_BQ)

  surfaces_[0] = SurfaceWindowPair(eglCreateWindowSurface(display(), config, window_.get(), NULL), NULL);
  if (CheckEGLError("eglCreateWindowSurface")) return false;