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

Commit 377d7bd5 authored by Mathias Agopian's avatar Mathias Agopian Committed by Android (Google) Code Review
Browse files

Merge "always pass the BufferQueue explicitely to consumers"

parents e77d6dd9 b550929b
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -200,7 +200,8 @@ static void SurfaceTexture_classInit(JNIEnv* env, jclass clazz)
static void SurfaceTexture_init(JNIEnv* env, jobject thiz, jint texName,
        jobject weakThiz, jboolean allowSynchronous)
{
    sp<GLConsumer> surfaceTexture(new GLConsumer(texName, allowSynchronous));
    sp<BufferQueue> bq = new BufferQueue(allowSynchronous);
    sp<GLConsumer> surfaceTexture(new GLConsumer(bq, texName));
    if (surfaceTexture == 0) {
        jniThrowException(env, OutOfResourcesException,
                "Unable to create native SurfaceTexture");
+2 −1
Original line number Diff line number Diff line
@@ -541,7 +541,8 @@ static void ImageReader_init(JNIEnv* env, jobject thiz, jobject weakThiz,

    nativeFormat = Image_getPixelFormat(env, format);

    sp<CpuConsumer> consumer = new CpuConsumer(maxImages);
    sp<BufferQueue> bq = new BufferQueue();
    sp<CpuConsumer> consumer = new CpuConsumer(bq, maxImages);
    // TODO: throw dvm exOutOfMemoryError?
    if (consumer == NULL) {
        jniThrowRuntimeException(env, "Failed to allocate native CpuConsumer");
+2 −1
Original line number Diff line number Diff line
@@ -160,7 +160,8 @@ bool GLEnv::InitWithNewContext() {
  }

  // Create dummy surface using a GLConsumer
  surfaceTexture_ = new GLConsumer(0);
  sp<BufferQueue> bq = new BufferQueue();
  surfaceTexture_ = new GLConsumer(bq, 0);
  window_ = new Surface(static_cast<sp<IGraphicBufferProducer> >(
          surfaceTexture_->getBufferQueue()));