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

Commit ae540b99 authored by Daniel Lam's avatar Daniel Lam
Browse files

rsdGL uses DummyConsumer

Using a DummyConsumer instead of a SurfaceTexture avoids
errors such as BufferQueue has been abandoned due to the SurfaceTexture
going out of scope and disconnecting from the BufferQueue.

Bug: 6172739
Change-Id: I775ead2d0392a68fd0f7e724d6eb25298d2fb00d
parent 0c44525a
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@
#include "rsdFrameBufferObj.h"

#include <gui/SurfaceTextureClient.h>
#include <gui/DummyConsumer.h>

using namespace android;
using namespace android::renderscript;
@@ -326,8 +327,11 @@ bool rsdGLInit(const Context *rsc) {
    }
    gGLContextCount++;

    sp<SurfaceTexture> st(new SurfaceTexture(123));
    sp<SurfaceTextureClient> stc(new SurfaceTextureClient(st));
    // Create a BufferQueue with a fake consumer
    sp<BufferQueue> bq = new BufferQueue();
    sp<DummyConsumer> dummy = new DummyConsumer(bq);
    sp<SurfaceTextureClient> stc(new SurfaceTextureClient(static_cast<sp<ISurfaceTexture> >(bq)));

    dc->gl.egl.surfaceDefault = eglCreateWindowSurface(dc->gl.egl.display, dc->gl.egl.config,
                                                       static_cast<ANativeWindow*>(stc.get()),
                                                       NULL);