diff options
| author | 2024-02-16 03:35:33 +0000 | |
|---|---|---|
| committer | 2024-02-16 03:35:33 +0000 | |
| commit | 1d6363aafcc8cc31bc0684b4a81fc9c0d44fe84d (patch) | |
| tree | 0e2bd5103ea6495bf7c66b90d8034ed2210b2597 /libs/gui/SurfaceComposerClient.cpp | |
| parent | 4238fc9134fce2cb12091f3a1e2aea3d7a2a363c (diff) | |
| parent | 1b0d4e16530a4feb99eafbfdfce2aeb39c5e23e3 (diff) | |
Merge "Add support for restricting HDR headroom for video" into main
Diffstat (limited to 'libs/gui/SurfaceComposerClient.cpp')
| -rw-r--r-- | libs/gui/SurfaceComposerClient.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp index 83c2b7f703..4f1356bebb 100644 --- a/libs/gui/SurfaceComposerClient.cpp +++ b/libs/gui/SurfaceComposerClient.cpp @@ -1808,6 +1808,20 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setExten return *this; } +SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setDesiredHdrHeadroom( + const sp<SurfaceControl>& sc, float desiredRatio) { + layer_state_t* s = getLayerState(sc); + if (!s) { + mStatus = BAD_INDEX; + return *this; + } + s->what |= layer_state_t::eDesiredHdrHeadroomChanged; + s->desiredHdrSdrRatio = desiredRatio; + + registerSurfaceControlForCallback(sc); + return *this; +} + SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setCachingHint( const sp<SurfaceControl>& sc, gui::CachingHint cachingHint) { layer_state_t* s = getLayerState(sc); |