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

Commit 86e28a5d authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "HWUI: reset buffer state only for ES3 context" am: 44a1a1e0 am: 3f68195f am: d41f58b2

parents 14ee54d3 d41f58b2
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -68,12 +68,15 @@ MakeCurrentResult SkiaOpenGLPipeline::makeCurrent() {
        return MakeCurrentResult::AlreadyCurrent;
    }

    // Make sure read/draw buffer state of default framebuffer is GL_BACK. Vendor implementations
    EGLint majorVersion = 0;
    eglQueryContext(eglGetCurrentDisplay(), eglGetCurrentContext(), EGL_CONTEXT_CLIENT_VERSION, &majorVersion);

    // Make sure read/draw buffer state of default framebuffer is GL_BACK for ES 3.X. Vendor implementations
    // disagree on the draw/read buffer state if the default framebuffer transitions from a surface
    // to EGL_NO_SURFACE and vice-versa. There was a related discussion within Khronos on this topic.
    // See https://cvs.khronos.org/bugzilla/show_bug.cgi?id=13534.
    // The discussion was not resolved with a clear consensus
    if (error == 0 && wasSurfaceless && mEglSurface != EGL_NO_SURFACE) {
    if (error == 0 && (majorVersion > 2) && wasSurfaceless && mEglSurface != EGL_NO_SURFACE) {
        GLint curReadFB = 0;
        GLint curDrawFB = 0;
        glGetIntegerv(GL_READ_FRAMEBUFFER_BINDING, &curReadFB);