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

Commit db4773f0 authored by Matt Sarett's avatar Matt Sarett
Browse files

Correct rowBytes on SkBitmap to match recycled bitmap sooner

This will prevent us from triggering asserts when we
call lockPixels().

skbug.com/4538

Change-Id: Ibcd18818e33ccbacdcdfa57e822b04dd91b6af17
parent 5210974c
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -717,7 +717,10 @@ bool RecyclingClippingPixelAllocator::allocPixelRef(SkBitmap* bitmap, SkColorTab
        // the SkImageInfo.
        mRecycledBitmap->reconfigure(mRecycledBitmap->info(), rowBytes, ctable);

        // This call will give the bitmap the same pixelRef as mRecycledBitmap.
        // Give the bitmap the same pixelRef as mRecycledBitmap.
        // skbug.com/4538: We also need to make sure that the rowBytes on the pixel ref
        //                 match the rowBytes on the bitmap.
        bitmap->setInfo(bitmap->info(), rowBytes);
        bitmap->setPixelRef(mRecycledBitmap->refPixelRef())->unref();

        // Make sure that the recycled bitmap has the correct alpha type.