EmuGL: remove broken EGL buffer refcounting
The emulator EGL implementation tried to hold its own reference to buffers acquired/released with dequeueBuffer/queueBuffer, but was missing an incRef after dequeueBuffer during swapBuffers. Since the native window holds a reference to the buffer between dequeueBuffer and queueBuffer, the EGL reference isn't needed anyway. Change-Id: I95e4f9f4faf59198f99939cdca6603fe176c56bc
This commit is contained in:
@@ -308,8 +308,6 @@ EGLBoolean egl_window_surface_t::connect()
|
||||
setErrorReturn(EGL_BAD_ALLOC, EGL_FALSE);
|
||||
}
|
||||
|
||||
buffer->common.incRef(&buffer->common);
|
||||
|
||||
// lock the buffer
|
||||
nativeWindow->lockBuffer(nativeWindow, buffer);
|
||||
|
||||
@@ -323,7 +321,6 @@ void egl_window_surface_t::disconnect()
|
||||
{
|
||||
if (buffer) {
|
||||
nativeWindow->queueBuffer(nativeWindow, buffer);
|
||||
buffer->common.decRef(&buffer->common);
|
||||
buffer = 0;
|
||||
}
|
||||
}
|
||||
@@ -338,16 +335,9 @@ EGLBoolean egl_window_surface_t::swapBuffers()
|
||||
|
||||
rcEnc->rcFlushWindowColorBuffer(rcEnc, rcSurface);
|
||||
|
||||
android_native_buffer_t* prevBuf = buffer;
|
||||
//post the back buffer
|
||||
nativeWindow->queueBuffer(nativeWindow, buffer);
|
||||
|
||||
buffer->common.incRef(&buffer->common);
|
||||
|
||||
if (prevBuf) {
|
||||
prevBuf->common.decRef(&prevBuf->common);
|
||||
}
|
||||
|
||||
// dequeue a new buffer
|
||||
if (nativeWindow->dequeueBuffer(nativeWindow, &buffer)) {
|
||||
setErrorReturn(EGL_BAD_ALLOC, EGL_FALSE);
|
||||
|
||||
Reference in New Issue
Block a user