diff options
| author | 2021-04-12 21:22:34 +0200 | |
|---|---|---|
| committer | 2021-04-12 21:35:49 +0200 | |
| commit | e0acf3825a6a6f746295079f77fbcea0a7046b8b (patch) | |
| tree | f3b8d8cbd2bb6f7cd4e20166d9e888bab46245e4 | |
| parent | 73939a9af7a32b1941877a85716f0c49c3892cae (diff) | |
Make blur regions alpha depend on layer alpha
Bug: 183109337
Test: m && flash && check blur region alpha animating
Change-Id: I17032051909c12aab60225a080b7431e0b35814a
| -rw-r--r-- | services/surfaceflinger/Layer.cpp | 9 | ||||
| -rw-r--r-- | services/surfaceflinger/Layer.h | 2 |
2 files changed, 8 insertions, 3 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp index 94fd62fa7a..3557fa71bd 100644 --- a/services/surfaceflinger/Layer.cpp +++ b/services/surfaceflinger/Layer.cpp @@ -2264,8 +2264,13 @@ int32_t Layer::getBackgroundBlurRadius() const { return parentAlpha * getDrawingState().backgroundBlurRadius; } -const std::vector<BlurRegion>& Layer::getBlurRegions() const { - return getDrawingState().blurRegions; +const std::vector<BlurRegion> Layer::getBlurRegions() const { + auto regionsCopy(getDrawingState().blurRegions); + int layerAlpha = getAlpha(); + for (auto& region : regionsCopy) { + region.alpha = region.alpha * layerAlpha; + } + return regionsCopy; } Layer::RoundedCornerState Layer::getRoundedCornerState() const { diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h index 3a45c949a4..a2a0da1d17 100644 --- a/services/surfaceflinger/Layer.h +++ b/services/surfaceflinger/Layer.h @@ -1192,7 +1192,7 @@ private: float mEffectiveShadowRadius = 0.f; // A list of regions on this layer that should have blurs. - const std::vector<BlurRegion>& getBlurRegions() const; + const std::vector<BlurRegion> getBlurRegions() const; }; std::ostream& operator<<(std::ostream& stream, const Layer::FrameRate& rate); |