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

Commit e37757c4 authored by Kaylee Lubick's avatar Kaylee Lubick
Browse files

Replace uses of SkPackARGB32 with SkColorSetARGB

The former is a private Skia API but functionally the same as SkColorSetARGB or SkColorSetRGB. I spotted a few cases in which a constant color could be used and changed those to aid readability

Change-Id: Ibd06d95f98f48ec8931a2e894096b89d76981bd4
Flag: EXEMPT refactoring
parent 334963a7
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -63,7 +63,7 @@ GIFMovie::GIFMovie(SkStream* stream)
    }
    fCurrIndex = -1;
    fLastDrawIndex = -1;
    fPaintingColor = SkPackARGB32(0, 0, 0, 0);
    fPaintingColor = SK_AlphaTRANSPARENT;
}

GIFMovie::~GIFMovie()
@@ -127,7 +127,7 @@ static void copyLine(uint32_t* dst, const unsigned char* src, const ColorMapObje
    for (; width > 0; width--, src++, dst++) {
        if (*src != transparent && *src < cmap->ColorCount) {
            const GifColorType& col = cmap->Colors[*src];
            *dst = SkPackARGB32(0xFF, col.Red, col.Green, col.Blue);
            *dst = SkColorSetRGB(col.Red, col.Green, col.Blue);
        }
    }
}
@@ -395,10 +395,10 @@ bool GIFMovie::onGetBitmap(SkBitmap* bm)
        lastIndex = fGIF->ImageCount - 1;
    }

    SkColor bgColor = SkPackARGB32(0, 0, 0, 0);
    SkColor bgColor = SK_ColorTRANSPARENT;
    if (gif->SColorMap != nullptr && gif->SBackGroundColor < gif->SColorMap->ColorCount) {
        const GifColorType& col = gif->SColorMap->Colors[gif->SBackGroundColor];
        bgColor = SkColorSetARGB(0xFF, col.Red, col.Green, col.Blue);
        bgColor = SkColorSetRGB(col.Red, col.Green, col.Blue);
    }

    // draw each frames - not intelligent way
@@ -411,7 +411,7 @@ bool GIFMovie::onGetBitmap(SkBitmap* bm)
            if (!trans && gif->SColorMap != nullptr) {
                fPaintingColor = bgColor;
            } else {
                fPaintingColor = SkColorSetARGB(0, 0, 0, 0);
                fPaintingColor = SK_ColorTRANSPARENT;
            }

            bm->eraseColor(fPaintingColor);