Fix regressed alpha change in VD
BUG: 116355161
Test: cts-tradefed run commandAndExit cts -d --skip-preconditions --test android.graphics.drawable.cts.VectorDrawableTest --module CtsGraphicsTestCases
Change-Id: I4d1bc13d8544d0fc64c5457f8a70c3089a9334c1
diff --git a/libs/hwui/VectorDrawable.cpp b/libs/hwui/VectorDrawable.cpp
index dbbe9f3..6cf04bf 100644
--- a/libs/hwui/VectorDrawable.cpp
+++ b/libs/hwui/VectorDrawable.cpp
@@ -470,10 +470,10 @@
void Tree::getPaintFor(SkPaint* outPaint, const TreeProperties &prop) const {
// HWUI always draws VD with bilinear filtering.
outPaint->setFilterQuality(kLow_SkFilterQuality);
- if (prop.getRootAlpha() < 1.0f || prop.getColorFilter() != nullptr) {
+ if (prop.getColorFilter() != nullptr) {
outPaint->setColorFilter(sk_ref_sp(prop.getColorFilter()));
- outPaint->setAlpha(prop.getRootAlpha() * 255);
}
+ outPaint->setAlpha(prop.getRootAlpha() * 255);
}
Bitmap& Tree::getBitmapUpdateIfDirty() {