From 9707f4df640c3369f873a934bb05ffa5a68a5640 Mon Sep 17 00:00:00 2001 From: Riley Andrews Date: Thu, 23 Oct 2014 16:17:04 -0700 Subject: Add glFlush in surfaceflinger screenshot code. After creating a syncKHR object with type EGL_SYNC_NATIVE_FENCE_ANDROID, glFlush must be called before the EGL_SYNC_NATIVE_FENCE_FD_ANDROID attribute is populated with a sync fd. We currently call eglDupNativeFenceFDANDROID before issuing the flush. Bug 18052459 Taken verbatim from matthew.k.gumbel@intel.com. Change-Id: I3781d14f92862076e2bca7d27341a6dc6e7e3775 --- services/surfaceflinger/SurfaceFlinger.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'services/surfaceflinger/SurfaceFlinger.cpp') diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 96a8adb..50968e7 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -3201,6 +3201,8 @@ status_t SurfaceFlinger::captureScreenImplLocked( EGLSyncKHR sync; if (!DEBUG_SCREENSHOTS) { sync = eglCreateSyncKHR(mEGLDisplay, EGL_SYNC_NATIVE_FENCE_ANDROID, NULL); + // native fence fd will not be populated until flush() is done. + getRenderEngine().flush(); } else { sync = EGL_NO_SYNC_KHR; } -- cgit v1.1