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

Commit cf920879 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "HWUI: Make releaseQueueOwnership thread-safety" into main

parents ff4bdcd4 255ee52d
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -140,6 +140,13 @@ void AutoBackendTextureRelease::releaseQueueOwnership(GrDirectContext* context)
        return;
    }

    if (!RenderThread::isCurrent()) {
        // releaseQueueOwnership needs to run on RenderThread to prevent multithread calling
        // setBackendTextureState will operate skia resource cache which need single owner
        RenderThread::getInstance().queue().post([this, context]() { releaseQueueOwnership(context); });
        return;
    }

    LOG_ALWAYS_FATAL_IF(Properties::getRenderPipelineType() != RenderPipelineType::SkiaVulkan);
    if (mBackendTexture.isValid()) {
        // Passing in VK_IMAGE_LAYOUT_UNDEFINED means we keep the old layout.