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

Commit c4c458c6 authored by Derek Sollenberger's avatar Derek Sollenberger
Browse files

Fix NinePatch decoder when the target is smaller than the source.

If the target is smaller on a given axis than the source then we
just draw a downscaled version of the NinePatch.  If we use the
current path and the source has transparency then areas of the
NinePatch overlap and are blended together resulting in visual
inconsistancy.

bug: 5041053
Change-Id: I0fcc6fb5c214b188a164acf0651aa4ab2f35946d
parent 2043b01b
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -160,6 +160,14 @@ void NinePatch_Draw(SkCanvas* canvas, const SkRect& bounds,
        return;
    }
    
    // if the nine patch is bigger than the dst on a given axis we cannot
    // stretch properly so just draw the bitmap as best as possible and return
    if (bitmap.width() >= bounds.width() || bitmap.height() >= bounds.height())
    {
        canvas->drawBitmapRect(bitmap, NULL, bounds, paint);
        return;
    }

    // should try a quick-reject test before calling lockPixels 

    SkAutoLockPixels alp(bitmap);