diff options
| author | 2021-04-13 08:12:00 +0000 | |
|---|---|---|
| committer | 2021-04-13 08:12:00 +0000 | |
| commit | d84eb5e09880acfe87bff5ee65bd587bb019ab62 (patch) | |
| tree | b2ace0a4c65a7a9dc51810cb91383ac31b04d10b | |
| parent | 80402b9369c0962f1a0932da7d0e1d555b605adb (diff) | |
| parent | e0acf3825a6a6f746295079f77fbcea0a7046b8b (diff) | |
Merge "Make blur regions alpha depend on layer alpha" into sc-dev
| -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 6038658ee6..829b91676b 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 5528a8190f..64986afd61 100644 --- a/services/surfaceflinger/Layer.h +++ b/services/surfaceflinger/Layer.h @@ -1191,7 +1191,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); |