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

Commit e0651a7b authored by Derek Sollenberger's avatar Derek Sollenberger Committed by Automerger Merge Worker
Browse files

Merge "Return to previous RenderEngine behavior for protected buffers" into sc-dev am: 46259c5c

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

Change-Id: I4398ab7df0447781ee3f014f1669315016a7e8e4
parents 5bd047d2 46259c5c
Loading
Loading
Loading
Loading
+5 −4
Original line number Original line Diff line number Diff line
@@ -505,10 +505,11 @@ void SkiaGLRenderEngine::mapExternalTextureBuffer(const sp<GraphicBuffer>& buffe
    if (mRenderEngineType != RenderEngineType::SKIA_GL_THREADED) {
    if (mRenderEngineType != RenderEngineType::SKIA_GL_THREADED) {
        return;
        return;
    }
    }
    // we currently don't attempt to map a buffer if the buffer contains protected content
    // We currently don't attempt to map a buffer if the buffer contains protected content
    // because GPU resources for protected buffers is much more limited.
    // or we are using a protected context because GPU resources for protected buffers is
    // much more limited.
    const bool isProtectedBuffer = buffer->getUsage() & GRALLOC_USAGE_PROTECTED;
    const bool isProtectedBuffer = buffer->getUsage() & GRALLOC_USAGE_PROTECTED;
    if (isProtectedBuffer) {
    if (isProtectedBuffer || mInProtectedContext) {
        return;
        return;
    }
    }
    ATRACE_CALL();
    ATRACE_CALL();
@@ -517,7 +518,7 @@ void SkiaGLRenderEngine::mapExternalTextureBuffer(const sp<GraphicBuffer>& buffe
    // bound context if we are not already using the protected context (and subsequently switch
    // bound context if we are not already using the protected context (and subsequently switch
    // back after the buffer is cached).
    // back after the buffer is cached).
    auto grContext = getActiveGrContext();
    auto grContext = getActiveGrContext();
    auto& cache = mInProtectedContext ? mProtectedTextureCache : mTextureCache;
    auto& cache = mTextureCache;


    std::lock_guard<std::mutex> lock(mRenderingMutex);
    std::lock_guard<std::mutex> lock(mRenderingMutex);
    mGraphicBufferExternalRefs[buffer->getId()]++;
    mGraphicBufferExternalRefs[buffer->getId()]++;