diff options
| author | 2023-06-26 22:29:52 +0000 | |
|---|---|---|
| committer | 2023-06-26 22:29:52 +0000 | |
| commit | f7752a2f2d9d741c35d5d5035f802792af440a8e (patch) | |
| tree | 0c802cd6438a2e20b70189b6d3e4916cb0c860d8 /libs/gui/SurfaceComposerClient.cpp | |
| parent | 48cfae79ea9e6e976c23599013e98842dbd01369 (diff) | |
| parent | ba60819b682643a91e8657295d52a3270a2f698a (diff) | |
Merge "Merge Android 13 QPR3"
Diffstat (limited to 'libs/gui/SurfaceComposerClient.cpp')
| -rw-r--r-- | libs/gui/SurfaceComposerClient.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp index 0f5192d41c..05beb07891 100644 --- a/libs/gui/SurfaceComposerClient.cpp +++ b/libs/gui/SurfaceComposerClient.cpp @@ -1274,8 +1274,11 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setAlpha mStatus = BAD_INDEX; return *this; } + if (alpha < 0.0f || alpha > 1.0f) { + ALOGE("SurfaceComposerClient::Transaction::setAlpha: invalid alpha %f, clamping", alpha); + } s->what |= layer_state_t::eAlphaChanged; - s->alpha = alpha; + s->alpha = std::clamp(alpha, 0.f, 1.f); registerSurfaceControlForCallback(sc); return *this; |