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

Commit 1ef217ef authored by jiayuanr's avatar jiayuanr Committed by Steve Kondik
Browse files

Remove getBoundTexture().

GetBoundTexture checks the bound and active texture,
and we should clear the id from all bound textures
(regardless of whether they're active or not).
Remove the check and getBoundTexture() method,
and just always call caches.unbindTexture(texture.id).

CRs-fixed: 681102

Change-Id: I481386394f382519bb7ea2700c4e808e00474c70
parent 3036adbf
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -563,10 +563,6 @@ void Caches::resetBoundTextures() {
    memset(mBoundTextures, 0, REQUIRED_TEXTURE_UNITS_COUNT * sizeof(GLuint));
}

uint32_t Caches::getBoundTexture() {
    return mBoundTextures[mTextureUnit];
}

void Caches::unbindTexture(GLuint texture) {
    for (int i = 0; i < REQUIRED_TEXTURE_UNITS_COUNT; i++) {
        if (mBoundTextures[i] == texture) {
+0 −5
Original line number Diff line number Diff line
@@ -263,11 +263,6 @@ public:
     */
    void resetBoundTextures();

    /**
     * Get the mBoundTextures[mTextureUnit].
     */
    uint32_t getBoundTexture();

    /**
     * Clear the cache of bound textures.
     */
+1 −3
Original line number Diff line number Diff line
@@ -171,9 +171,7 @@ void Layer::deleteTexture() {
}

void Layer::clearTexture() {
    if (texture.id == caches.getBoundTexture()) {
    caches.unbindTexture(texture.id);
    }
    texture.id = 0;
}