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

Commit fac5ec2e authored by Alec Mouri's avatar Alec Mouri
Browse files

Dispatch tonemapAndDrawGainmap on main thread with non-threaded RE

Bug: 404962998
Flag: EXEMPT bug fix
Test: builds
Change-Id: Ia9cbe71665cd11fc5076204776ef4bac85ff7c05
parent 7d0d256b
Loading
Loading
Loading
Loading
+16 −6
Original line number Diff line number Diff line
@@ -7876,12 +7876,22 @@ ftl::SharedFuture<FenceResult> SurfaceFlinger::captureScreenshot(
                                return fenceResult;
                            }

                            auto tonemapAndDrawGainmap = [&]() -> FenceResult {
                                return getRenderEngine()
                                    .tonemapAndDrawGainmap(hdrBuffer, fenceResult.value()->get(),
                                        .tonemapAndDrawGainmap(hdrBuffer,
                                                               fenceResult.value()->get(),
                                                               hdrSdrRatio,
                                                           static_cast<ui::Dataspace>(dataspace),
                                                               static_cast<ui::Dataspace>(
                                                                       dataspace),
                                                               buffer, gainmapBuffer)
                                        .get();
                            };

                            if (mRenderEngine->isThreaded()) {
                                return tonemapAndDrawGainmap();
                            } else {
                                return mScheduler->schedule(std::move(tonemapAndDrawGainmap)).get();
                            }
                        })
                        .share();
    } else {