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
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:9af38ba9d5f9de413d87a64165226a2b488059a8)
Merged-In: I3110de534d6ef1ad16f9f94d30874bca6f8838c9
Change-Id: I3110de534d6ef1ad16f9f94d30874bca6f8838c9
diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h
index e3e72ed..f1989db 100644
--- a/services/surfaceflinger/SurfaceFlinger.h
+++ b/services/surfaceflinger/SurfaceFlinger.h
@@ -323,6 +323,11 @@
     // on this behavior to increase contrast for some media sources.
     bool mTreat170mAsSrgb = false;
 
+    // If true, then screenshots with an enhanced render intent will dim in gamma space.
+    // The purpose is to ensure that screenshots appear correct during system animations for devices
+    // that require that dimming must occur in gamma space.
+    bool mDimInGammaSpaceForEnhancedScreenshots = false;
+
     // Allows to ignore physical orientation provided through hwc API in favour of
     // 'ro.surface_flinger.primary_display_orientation'.
     // TODO(b/246793311): Clean up a temporary property