Changed eglSwapBuffers to actually signal an error when swapBuffers
fails. This was hiding an error log at the SurfaceFlinger callsite.
When eglSwapBuffers is called after a prior error, we should not try to
enqueue a NULL buffer which was causing a segfault that takes down
SurfaceFlinger.
Bug:
33432596
Change-Id: I72f3301e0adbc4ea75266c9c1c9e01d9169036e7
int presentFenceFd = -1;
+ if (buffer == NULL) {
+ ALOGE("egl_window_surface_t::swapBuffers called with NULL buffer");
+ setErrorReturn(EGL_BAD_SURFACE, EGL_FALSE);
+ }
+
#if PLATFORM_SDK_VERSION <= 16
rcEnc->rcFlushWindowColorBuffer(rcEnc, rcSurface);
// equivalent to glFinish if no native sync
setErrorReturn(EGL_BAD_DISPLAY, EGL_FALSE);
// post the surface
- d->swapBuffers();
+ EGLBoolean ret = d->swapBuffers();
hostCon->flush();
- return EGL_TRUE;
+ return ret;
}
EGLBoolean eglCopyBuffers(EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target)