From 342f621ade811982fb08fa01fd493629913ce549 Mon Sep 17 00:00:00 2001 From: John Reck Date: Tue, 14 Mar 2023 21:58:26 -0400 Subject: Add sysprop to control HDR headroom To accelerate tuning of the value allow it to be sysprop driven Bug: 273624684 Test: change prop, verify silkfx headroom changes after re-launch Change-Id: Ibad662b7ba06bd821c7a3ce48c19f4c94c716b5e --- libs/hwui/Properties.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'libs/hwui/Properties.cpp') diff --git a/libs/hwui/Properties.cpp b/libs/hwui/Properties.cpp index b0896daee2a1..9df6822b4867 100644 --- a/libs/hwui/Properties.cpp +++ b/libs/hwui/Properties.cpp @@ -91,6 +91,8 @@ bool Properties::isHighEndGfx = true; bool Properties::isLowRam = false; bool Properties::isSystemOrPersistent = false; +float Properties::maxHdrHeadroomOn8bit = 5.f; // TODO: Refine this number + StretchEffectBehavior Properties::stretchEffectBehavior = StretchEffectBehavior::ShaderHWUI; DrawingEnabled Properties::drawingEnabled = DrawingEnabled::NotInitialized; @@ -150,6 +152,11 @@ bool Properties::load() { enableWebViewOverlays = base::GetBoolProperty(PROPERTY_WEBVIEW_OVERLAYS_ENABLED, true); + auto hdrHeadroom = (float)atof(base::GetProperty(PROPERTY_8BIT_HDR_HEADROOM, "").c_str()); + if (hdrHeadroom >= 1.f) { + maxHdrHeadroomOn8bit = std::min(hdrHeadroom, 100.f); + } + // call isDrawingEnabled to force loading of the property isDrawingEnabled(); -- cgit v1.2.3-59-g8ed1b