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

Commit 7f5e15b3 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Remove unreachable code now that we no longer cache protected buffers"...

Merge "Remove unreachable code now that we no longer cache protected buffers" into sc-dev am: 96e84d98 am: 0349c776

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/native/+/14441750

Change-Id: I2ec0d4bf10d3be5f71a4be2ea07a76bf9939b3c4
parents 583f3df5 0349c776
Loading
Loading
Loading
Loading
+3 −10
Original line number Diff line number Diff line
@@ -513,14 +513,9 @@ void SkiaGLRenderEngine::mapExternalTextureBuffer(const sp<GraphicBuffer>& buffe
    }
    ATRACE_CALL();

    // We need to switch the currently bound context if the buffer is protected but the current
    // context is not. The current state must then be restored after the buffer is cached.
    const bool protectedContextState = mInProtectedContext;
    if (!useProtectedContext(protectedContextState || isProtectedBuffer)) {
        ALOGE("Attempting to cache a buffer into a different context than what is currently bound");
        return;
    }

    // If we were to support caching protected buffers then we will need to switch the currently
    // bound context if we are not already using the protected context (and subsequently switch
    // back after the buffer is cached).
    auto grContext = getActiveGrContext();
    auto& cache = mInProtectedContext ? mProtectedTextureCache : mTextureCache;

@@ -534,8 +529,6 @@ void SkiaGLRenderEngine::mapExternalTextureBuffer(const sp<GraphicBuffer>& buffe
                                                               isRenderable);
        cache.insert({buffer->getId(), imageTextureRef});
    }
    // restore the original state of the protected context if necessary
    useProtectedContext(protectedContextState);
}

void SkiaGLRenderEngine::unmapExternalTextureBuffer(const sp<GraphicBuffer>& buffer) {