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

Commit 98427708 authored by Chris Craik's avatar Chris Craik Committed by Android (Google) Code Review
Browse files

Merge "Ensure glActiveTexture is cleaned up correctly on functor resume"

parents fd23eca5 9ab2d184
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -495,6 +495,10 @@ void Caches::activeTexture(GLuint textureUnit) {
    }
}

void Caches::resetActiveTexture() {
    mTextureUnit = -1;
}

void Caches::bindTexture(GLuint texture) {
    if (mBoundTextures[mTextureUnit] != texture) {
        glBindTexture(GL_TEXTURE_2D, texture);
+5 −0
Original line number Diff line number Diff line
@@ -225,6 +225,11 @@ public:
     */
    void activeTexture(GLuint textureUnit);

    /**
     * Invalidate the cached value of the active texture unit.
     */
    void resetActiveTexture();

    /**
     * Binds the specified texture as a GL_TEXTURE_2D texture.
     * All texture bindings must be performed with this method or
+1 −0
Original line number Diff line number Diff line
@@ -360,6 +360,7 @@ void OpenGLRenderer::interrupt() {
            mCaches.currentProgram = NULL;
        }
    }
    mCaches.resetActiveTexture();
    mCaches.unbindMeshBuffer();
    mCaches.unbindIndicesBuffer();
    mCaches.resetVertexPointers();