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

Commit 727fb94d authored by Sangkyu Lee's avatar Sangkyu Lee Committed by Steve Kondik
Browse files

Add missing glFlush call

According to EGL_ANDROID_native_fence_sync specification,
glFlush should be called to make a new native fence object created
after eglCreateSyncKHR is called.

Change-Id: Ifea69d3c3bca27aef246e1b7baaae6e962257f1e
parent 90d22bce
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -246,6 +246,10 @@ void RenderEngine::readPixels(size_t l, size_t b, size_t w, size_t h, uint32_t*
    glReadPixels(l, b, w, h, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
}

void RenderEngine::flush() {
    glFlush();
}

void RenderEngine::dump(String8& result) {
    const GLExtensions& extensions(GLExtensions::getInstance());
    result.appendFormat("GLES: %s, %s, %s\n",
+1 −0
Original line number Diff line number Diff line
@@ -77,6 +77,7 @@ public:
    void genTextures(size_t count, uint32_t* names);
    void deleteTextures(size_t count, uint32_t const* names);
    void readPixels(size_t l, size_t b, size_t w, size_t h, uint32_t* pixels);
    void flush();

    class BindImageAsFramebuffer {
        RenderEngine& mEngine;
+1 −0
Original line number Diff line number Diff line
@@ -3681,6 +3681,7 @@ status_t SurfaceFlinger::captureScreenImplLocked(
                        }
                        if (sync != EGL_NO_SYNC_KHR) {
                            // get the sync fd
                            getRenderEngine().flush();
                            syncFd = eglDupNativeFenceFDANDROID(mEGLDisplay, sync);
                            if (syncFd == EGL_NO_NATIVE_FENCE_FD_ANDROID) {
                                ALOGW("captureScreen: failed to dup sync khr object");