diff options
author | Mike Reed <reed@google.com> | 2021-01-28 18:06:26 -0500 |
---|---|---|
committer | Mike Reed <reed@google.com> | 2021-01-29 11:46:48 -0500 |
commit | 7994a3120b96f079a8100599f1bb5a5a6571e96e (patch) | |
tree | 7fdcb2b4cd4d677467d5b47560c72facff33c8a8 /libs/hwui/VectorDrawable.cpp | |
parent | 7ee87037f51e651e43c207c67582b36999b3de4a (diff) |
Modernize calls to drawImage
1. drawBitmap --> drawImage
2. drawImage now always requires sampling parameter
Bug:178700363
Test: make
Change-Id: I96f610a180b3774ba955cc334949fd62b1cf4d69
Diffstat (limited to 'libs/hwui/VectorDrawable.cpp')
-rw-r--r-- | libs/hwui/VectorDrawable.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libs/hwui/VectorDrawable.cpp b/libs/hwui/VectorDrawable.cpp index 6030c36add7a..4a21ad6ab945 100644 --- a/libs/hwui/VectorDrawable.cpp +++ b/libs/hwui/VectorDrawable.cpp @@ -507,10 +507,12 @@ void Tree::draw(SkCanvas* canvas, const SkRect& bounds, const SkPaint& inPaint) sk_sp<SkImage> cachedBitmap = getBitmapUpdateIfDirty().makeImage(); + // HWUI always draws VD with bilinear filtering. + auto sampling = SkSamplingOptions(SkFilterMode::kLinear); int scaledWidth = SkScalarCeilToInt(mProperties.getScaledWidth()); int scaledHeight = SkScalarCeilToInt(mProperties.getScaledHeight()); canvas->drawImageRect(cachedBitmap, SkRect::MakeWH(scaledWidth, scaledHeight), bounds, - &paint, SkCanvas::kFast_SrcRectConstraint); + sampling, &paint, SkCanvas::kFast_SrcRectConstraint); } void Tree::updateBitmapCache(Bitmap& bitmap, bool useStagingData) { |