Make blur regions alpha depend on layer alpha
Bug: 183109337
Test: m && flash && check blur region alpha animating
Change-Id: I17032051909c12aab60225a080b7431e0b35814a
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index 94fd62f..3557fa7 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -2264,8 +2264,13 @@
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 {