Store filterbitmap on Paint
Update Paint and SkiaCanvas now that SkFilterQuality is no longer
part of Skia's API.
1. Store mFilterBitmap:bool directly in Paint (matching java side)
2. Change Looper construct to operate on Paint rather than SkPaint
... so it can access mFilterBitmap.
3. Update PaintFilter to take Paint instead of SkPaint
As before, when we do have to call SkCanvas, we convert Paint's
mFilterBitmap into SkSamplingOptions as needed.
Test: make
Bug: 178700363
Change-Id: I7fccf17657d4e255f2453b4bfc513215503597b2
diff --git a/libs/hwui/VectorDrawable.cpp b/libs/hwui/VectorDrawable.cpp
index 55f434f..f116641 100644
--- a/libs/hwui/VectorDrawable.cpp
+++ b/libs/hwui/VectorDrawable.cpp
@@ -463,10 +463,10 @@
mStagingCache.dirty = false;
}
- SkPaint skp;
+ Paint skp;
getPaintFor(&skp, mStagingProperties);
Paint paint;
- paint.setFilterQuality(skp.getFilterQuality());
+ paint.setFilterBitmap(skp.isFilterBitmap());
paint.setColorFilter(skp.refColorFilter());
paint.setAlpha(skp.getAlpha());
outCanvas->drawBitmap(*mStagingCache.bitmap, 0, 0, mStagingCache.bitmap->width(),
@@ -476,9 +476,9 @@
mStagingProperties.getBounds().bottom(), &paint);
}
-void Tree::getPaintFor(SkPaint* outPaint, const TreeProperties& prop) const {
+void Tree::getPaintFor(Paint* outPaint, const TreeProperties& prop) const {
// HWUI always draws VD with bilinear filtering.
- outPaint->setFilterQuality(kLow_SkFilterQuality);
+ outPaint->setFilterBitmap(true);
if (prop.getColorFilter() != nullptr) {
outPaint->setColorFilter(sk_ref_sp(prop.getColorFilter()));
}