summaryrefslogtreecommitdiff
path: root/services/surfaceflinger/ScreenCaptureOutput.cpp
diff options
context:
space:
mode:
author Alec Mouri <alecmouri@google.com> 2024-05-24 18:21:21 +0000
committer Alec Mouri <alecmouri@google.com> 2024-05-24 18:27:32 +0000
commita7e752e25f54296c907ddbf5a682990bf9e85f6d (patch)
tree87c569600f79d3a9721589bf6d65baf8f53bbd49 /services/surfaceflinger/ScreenCaptureOutput.cpp
parentef7f5d11c09ff046e4cf5420aaf07c8baa01aded (diff)
Plumb in local tonemapping flag into renderengine
The detailed local tonemapping implementation will come in a later CL. Also allow the flag to configure luminance spaces in SF, to prevent SDR-only regions from dimming. Bug: 329464641 Test: builds Change-Id: Ia2bbf12b2cdfb5597137a6028911ff71b3d866d3
Diffstat (limited to 'services/surfaceflinger/ScreenCaptureOutput.cpp')
-rw-r--r--services/surfaceflinger/ScreenCaptureOutput.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/services/surfaceflinger/ScreenCaptureOutput.cpp b/services/surfaceflinger/ScreenCaptureOutput.cpp
index dd03366bcc..8bb72b8470 100644
--- a/services/surfaceflinger/ScreenCaptureOutput.cpp
+++ b/services/surfaceflinger/ScreenCaptureOutput.cpp
@@ -30,7 +30,7 @@ std::shared_ptr<ScreenCaptureOutput> createScreenCaptureOutput(ScreenCaptureOutp
ScreenCaptureOutput, compositionengine::CompositionEngine, const RenderArea&,
const compositionengine::Output::ColorProfile&,
bool>(args.compositionEngine, args.renderArea, args.colorProfile, args.regionSampling,
- args.dimInGammaSpaceForEnhancedScreenshots);
+ args.dimInGammaSpaceForEnhancedScreenshots, args.enableLocalTonemapping);
output->editState().isSecure = args.renderArea.isSecure();
output->editState().isProtected = args.isProtected;
output->setCompositionEnabled(true);
@@ -63,11 +63,13 @@ std::shared_ptr<ScreenCaptureOutput> createScreenCaptureOutput(ScreenCaptureOutp
ScreenCaptureOutput::ScreenCaptureOutput(
const RenderArea& renderArea, const compositionengine::Output::ColorProfile& colorProfile,
- bool regionSampling, bool dimInGammaSpaceForEnhancedScreenshots)
+ bool regionSampling, bool dimInGammaSpaceForEnhancedScreenshots,
+ bool enableLocalTonemapping)
: mRenderArea(renderArea),
mColorProfile(colorProfile),
mRegionSampling(regionSampling),
- mDimInGammaSpaceForEnhancedScreenshots(dimInGammaSpaceForEnhancedScreenshots) {}
+ mDimInGammaSpaceForEnhancedScreenshots(dimInGammaSpaceForEnhancedScreenshots),
+ mEnableLocalTonemapping(enableLocalTonemapping) {}
void ScreenCaptureOutput::updateColorProfile(const compositionengine::CompositionRefreshArgs&) {
auto& outputState = editState();
@@ -88,6 +90,11 @@ renderengine::DisplaySettings ScreenCaptureOutput::generateClientCompositionDisp
aidl::android::hardware::graphics::composer3::DimmingStage::GAMMA_OETF;
}
+ if (mEnableLocalTonemapping) {
+ clientCompositionDisplay.tonemapStrategy =
+ renderengine::DisplaySettings::TonemapStrategy::Local;
+ }
+
return clientCompositionDisplay;
}