Skip to content

Commit f110207

Browse files
Treehugger RobotAndroid (Google) Code Review
authored andcommitted
Merge "Dispatch tonemapAndDrawGainmap on main thread with non-threaded RE" into main
2 parents 968f1fb + fac5ec2 commit f110207

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

services/surfaceflinger/SurfaceFlinger.cpp

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff 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 {

0 commit comments

Comments
 (0)