summaryrefslogtreecommitdiff
path: root/libs/gui/SurfaceComposerClient.cpp
diff options
context:
space:
mode:
author Sally Qi <sallyqi@google.com> 2022-03-31 23:19:05 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2022-03-31 23:19:05 +0000
commitd7590c4ad67981c141a7801ac0535100b97cfaf9 (patch)
tree7ea9104b1abc3daae229047a761f4fec8552ea84 /libs/gui/SurfaceComposerClient.cpp
parent840bc7c8dc65a258dd295a5c3c5bc388f5175327 (diff)
parent81d95e6534106159210a768268fd77f21139e7a9 (diff)
Merge "[SurfaceFlinger] Disable HDR dimming when screen rotates." into tm-dev
Diffstat (limited to 'libs/gui/SurfaceComposerClient.cpp')
-rw-r--r--libs/gui/SurfaceComposerClient.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp
index 52a22a77fd..6c197c457c 100644
--- a/libs/gui/SurfaceComposerClient.cpp
+++ b/libs/gui/SurfaceComposerClient.cpp
@@ -1195,6 +1195,20 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setTrans
return *this;
}
+SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setDimmingEnabled(
+ const sp<SurfaceControl>& sc, bool dimmingEnabled) {
+ layer_state_t* s = getLayerState(sc);
+ if (!s) {
+ mStatus = BAD_INDEX;
+ return *this;
+ }
+ s->what |= layer_state_t::eDimmingEnabledChanged;
+ s->dimmingEnabled = dimmingEnabled;
+
+ registerSurfaceControlForCallback(sc);
+ return *this;
+}
+
SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setAlpha(
const sp<SurfaceControl>& sc, float alpha) {
layer_state_t* s = getLayerState(sc);