summaryrefslogtreecommitdiff
path: root/services/surfaceflinger/SurfaceFlinger.cpp
diff options
context:
space:
mode:
author Alec Mouri <alecmouri@google.com> 2023-08-16 22:41:14 +0000
committer Alec Mouri <alecmouri@google.com> 2023-08-17 16:51:56 +0000
commit9af38ba9d5f9de413d87a64165226a2b488059a8 (patch)
tree42d6caf3b69c6c72adfd01b1ee9696b470557876 /services/surfaceflinger/SurfaceFlinger.cpp
parentc3a17824aed485229dba17819e5ee4e4ecf4db1e (diff)
Dim correctly in screenshots on some devices
Some devices are configured to dim in gamma space for non-colorimetric rendering intents. This configuration is a per-frame configuration on HWC, but that doesn't work for screenshots. Bug: 293560925 Test: HDR playback in youtube and rotate Change-Id: I3110de534d6ef1ad16f9f94d30874bca6f8838c9
Diffstat (limited to 'services/surfaceflinger/SurfaceFlinger.cpp')
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 9e6e934648..5c000ed8f5 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -452,6 +452,9 @@ SurfaceFlinger::SurfaceFlinger(Factory& factory) : SurfaceFlinger(factory, SkipI
property_get("debug.sf.treat_170m_as_sRGB", value, "0");
mTreat170mAsSrgb = atoi(value);
+ property_get("debug.sf.dim_in_gamma_in_enhanced_screenshots", value, 0);
+ mDimInGammaSpaceForEnhancedScreenshots = atoi(value);
+
mIgnoreHwcPhysicalDisplayOrientation =
base::GetBoolProperty("debug.sf.ignore_hwc_physical_display_orientation"s, false);
@@ -7787,7 +7790,9 @@ ftl::SharedFuture<FenceResult> SurfaceFlinger::renderScreenImpl(
.displayBrightnessNits = displayBrightnessNits,
.targetBrightness = targetBrightness,
.regionSampling = regionSampling,
- .treat170mAsSrgb = mTreat170mAsSrgb});
+ .treat170mAsSrgb = mTreat170mAsSrgb,
+ .dimInGammaSpaceForEnhancedScreenshots =
+ mDimInGammaSpaceForEnhancedScreenshots});
const float colorSaturation = grayscale ? 0 : 1;
compositionengine::CompositionRefreshArgs refreshArgs{