summaryrefslogtreecommitdiff
path: root/libs/hwui/VectorDrawable.cpp
diff options
context:
space:
mode:
authorStan Iliev <stani@google.com>2018-07-30 18:31:46 -0400
committerStan Iliev <stani@google.com>2018-07-31 15:11:31 +0000
commit038fc3732d547d78227da2d1ef6898213e05b153 (patch)
tree7933fcefe0999c7f472efcd39b4ecbe327984b5b /libs/hwui/VectorDrawable.cpp
parentbd49376225b0db80f6a49aa18e9c147695742784 (diff)
Set bilinear filter quality when drawing VectorDrawable
Set filter quality to GL_LINEAR, when drawing VectorDrawable cache into the frame buffer. Bug: 77841258 Test: Search bar icon jagged edge in launcher fixed Change-Id: I91270f64964ae3ba7a47264aec395bc2c2d9e968
Diffstat (limited to 'libs/hwui/VectorDrawable.cpp')
-rw-r--r--libs/hwui/VectorDrawable.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/libs/hwui/VectorDrawable.cpp b/libs/hwui/VectorDrawable.cpp
index 402fbadfec22..9f82d0fa3018 100644
--- a/libs/hwui/VectorDrawable.cpp
+++ b/libs/hwui/VectorDrawable.cpp
@@ -474,14 +474,13 @@ SkPaint* Tree::getPaint() {
// Update the given paint with alpha and color filter. Return nullptr if no color filter is
// specified and root alpha is 1. Otherwise, return updated paint.
SkPaint* Tree::updatePaint(SkPaint* outPaint, TreeProperties* prop) {
- if (prop->getRootAlpha() == 1.0f && prop->getColorFilter() == nullptr) {
- return nullptr;
- } else {
+ // HWUI always draws VD with bilinear filtering.
+ outPaint->setFilterQuality(kLow_SkFilterQuality);
+ if (prop->getRootAlpha() < 1.0f || prop->getColorFilter() != nullptr) {
outPaint->setColorFilter(sk_ref_sp(prop->getColorFilter()));
- outPaint->setFilterQuality(kLow_SkFilterQuality);
outPaint->setAlpha(prop->getRootAlpha() * 255);
- return outPaint;
}
+ return outPaint;
}
Bitmap& Tree::getBitmapUpdateIfDirty() {