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

Commit 519d4f4a authored by Derek Sollenberger's avatar Derek Sollenberger Committed by android-build-merger
Browse files

Merge "Support copying from index8 into another index8." into oc-dr1-dev

am: f112fde9

Change-Id: I3b913c4b139d4b64cec3f0564f5ff357203c299d
parents c7b39335 f112fde9
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -752,7 +752,8 @@ static jobject Bitmap_creator(JNIEnv* env, jobject, jintArray jColors,


static bool bitmapCopyTo(SkBitmap* dst, SkColorType dstCT, const SkBitmap& src,
static bool bitmapCopyTo(SkBitmap* dst, SkColorType dstCT, const SkBitmap& src,
        SkBitmap::Allocator* alloc) {
        SkBitmap::Allocator* alloc) {
    LOG_ALWAYS_FATAL_IF(kIndex_8_SkColorType == dstCT, "Error, cannot copyTo kIndex8.");
    LOG_ALWAYS_FATAL_IF(kIndex_8_SkColorType == dstCT &&
            kIndex_8_SkColorType != src.colorType(), "Error, cannot copyTo kIndex8.");


    SkPixmap srcPM;
    SkPixmap srcPM;
    if (!src.peekPixels(&srcPM)) {
    if (!src.peekPixels(&srcPM)) {
@@ -787,7 +788,7 @@ static bool bitmapCopyTo(SkBitmap* dst, SkColorType dstCT, const SkBitmap& src,
    if (!dst->setInfo(dstInfo)) {
    if (!dst->setInfo(dstInfo)) {
        return false;
        return false;
    }
    }
    if (!dst->tryAllocPixels(alloc, nullptr)) {
    if (!dst->tryAllocPixels(alloc, srcPM.ctable())) {
        return false;
        return false;
    }
    }