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

Commit 3ea0aae1 authored by Leon Scroggins's avatar Leon Scroggins Committed by android-build-merger
Browse files

Merge "Use filtering when drawing nine-patches" into pi-dev

am: b638985c

Change-Id: Id7dfab69b931a96d802c0ab43a06fc74267aff5c
parents 93ba4e7a b638985c
Loading
Loading
Loading
Loading
+14 −2
Original line number Diff line number Diff line
@@ -219,8 +219,20 @@ void SkiaRecordingCanvas::drawNinePatch(Bitmap& bitmap, const Res_png_9patch& ch
    SkPaint tmpPaint;
    sk_sp<SkColorFilter> colorFilter;
    sk_sp<SkImage> image = bitmap.makeImage(&colorFilter);
    mRecorder.drawImageLattice(image.get(), lattice, dst,
                               bitmapPaint(paint, &tmpPaint, colorFilter));
    const SkPaint* filteredPaint = bitmapPaint(paint, &tmpPaint, colorFilter);
    // Besides kNone, the other three SkFilterQualities are treated the same. And Android's
    // Java API only supports kLow and kNone anyway.
    if (!filteredPaint || filteredPaint->getFilterQuality() == kNone_SkFilterQuality) {
        if (filteredPaint != &tmpPaint) {
            if (paint) {
                tmpPaint = *paint;
            }
            filteredPaint = &tmpPaint;
        }
        tmpPaint.setFilterQuality(kLow_SkFilterQuality);
    }

    mRecorder.drawImageLattice(image.get(), lattice, dst, filteredPaint);
    if (!bitmap.isImmutable() && image.get() && !image->unique() && !dst.isEmpty()) {
        mDisplayList->mMutableImages.push_back(image.get());
    }