Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0e540d05 authored by Mike Reed's avatar Mike Reed
Browse files

Fix nine-patches to always filter

Regression was introduced here:
https://android.git.corp.google.com/platform/frameworks/base/+/c2dbc03acc61e3d4303afbbc63c8e7144f617846

Test: make

Change-Id: I8153f1d6ecd850953369dd664da88915c3842bb5
parent 8e713dbd
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -304,10 +304,13 @@ void SkiaRecordingCanvas::drawNinePatch(Bitmap& bitmap, const Res_png_9patch& ch
    SkRect dst = SkRect::MakeLTRB(dstLeft, dstTop, dstRight, dstBottom);
    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,
                const SkPaint* p) {
        mRecorder.drawImageLattice(image, lattice, dst.makeOffset(x, y), Paint_to_filter(p),
                                   p, bitmap.palette());
        mRecorder.drawImageLattice(image, lattice, dst.makeOffset(x, y), filter, p,
                                   bitmap.palette());
    });

    if (!bitmap.isImmutable() && image.get() && !image->unique() && !dst.isEmpty()) {