File tree Expand file tree Collapse file tree 1 file changed +16
-6
lines changed
Expand file tree Collapse file tree 1 file changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -7887,12 +7887,22 @@ ftl::SharedFuture<FenceResult> SurfaceFlinger::captureScreenshot(
78877887 return fenceResult;
78887888 }
78897889
7890- return getRenderEngine ()
7891- .tonemapAndDrawGainmap (hdrBuffer, fenceResult.value ()->get (),
7892- hdrSdrRatio,
7893- static_cast <ui::Dataspace>(dataspace),
7894- buffer, gainmapBuffer)
7895- .get ();
7890+ auto tonemapAndDrawGainmap = [&]() -> FenceResult {
7891+ return getRenderEngine ()
7892+ .tonemapAndDrawGainmap (hdrBuffer,
7893+ fenceResult.value ()->get (),
7894+ hdrSdrRatio,
7895+ static_cast <ui::Dataspace>(
7896+ dataspace),
7897+ buffer, gainmapBuffer)
7898+ .get ();
7899+ };
7900+
7901+ if (mRenderEngine ->isThreaded ()) {
7902+ return tonemapAndDrawGainmap ();
7903+ } else {
7904+ return mScheduler ->schedule (std::move (tonemapAndDrawGainmap)).get ();
7905+ }
78967906 })
78977907 .share ();
78987908 } else {
You can’t perform that action at this time.
0 commit comments