Respect LayerSettings::alpha in Skia-RE for buffer layers
Test: Manual. Open notification. Check whether the alpha of
the shade is correct.
Bug: 173418499
Change-Id: I768fe3046bbcce3ab3156a0ced9fc14f34f4f1bc
diff --git a/libs/renderengine/skia/SkiaGLRenderEngine.cpp b/libs/renderengine/skia/SkiaGLRenderEngine.cpp
index aefedb4..032e9b9 100644
--- a/libs/renderengine/skia/SkiaGLRenderEngine.cpp
+++ b/libs/renderengine/skia/SkiaGLRenderEngine.cpp
@@ -678,6 +678,8 @@
} else {
paint.setShader(shader);
}
+ // Make sure to take into the account the alpha set on the layer.
+ paint.setAlphaf(layer->alpha);
} else {
ATRACE_NAME("DrawColor");
const auto color = layer->source.solidColor;
@@ -824,7 +826,7 @@
ATRACE_CALL();
SkPaint paint;
- paint.setAlpha(static_cast<int>(effectRegion.alpha * 255));
+ paint.setAlphaf(effectRegion.alpha);
const auto matrix = mBlurFilter->getShaderMatrix();
paint.setShader(blurredSurface->makeImageSnapshot()->makeShader(matrix));