Fix nine-patches to always filter
Regression was introduced here:
c2dbc03acc
Test: make
Change-Id: I8153f1d6ecd850953369dd664da88915c3842bb5
This commit is contained in:
@@ -304,10 +304,13 @@ void SkiaRecordingCanvas::drawNinePatch(Bitmap& bitmap, const Res_png_9patch& ch
|
|||||||
SkRect dst = SkRect::MakeLTRB(dstLeft, dstTop, dstRight, dstBottom);
|
SkRect dst = SkRect::MakeLTRB(dstLeft, dstTop, dstRight, dstBottom);
|
||||||
sk_sp<SkImage> image = bitmap.makeImage();
|
sk_sp<SkImage> image = bitmap.makeImage();
|
||||||
|
|
||||||
|
// HWUI always draws 9-patches with linear filtering, regardless of the Paint.
|
||||||
|
const SkFilterMode filter = SkFilterMode::kLinear;
|
||||||
|
|
||||||
applyLooper(get_looper(paint), filterBitmap(paint), [&](SkScalar x, SkScalar y,
|
applyLooper(get_looper(paint), filterBitmap(paint), [&](SkScalar x, SkScalar y,
|
||||||
const SkPaint* p) {
|
const SkPaint* p) {
|
||||||
mRecorder.drawImageLattice(image, lattice, dst.makeOffset(x, y), Paint_to_filter(p),
|
mRecorder.drawImageLattice(image, lattice, dst.makeOffset(x, y), filter, p,
|
||||||
p, bitmap.palette());
|
bitmap.palette());
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!bitmap.isImmutable() && image.get() && !image->unique() && !dst.isEmpty()) {
|
if (!bitmap.isImmutable() && image.get() && !image->unique() && !dst.isEmpty()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user