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

Commit 78b7ddc1 authored by Greg Daniel's avatar Greg Daniel
Browse files

Couple fixes to HardwareBitmapUploader.

When we had to make a copy SkBitmap for an unsupported format, we
were dropping the color space information.

Added a null check in terminate.

Test: manual build and running on blueline
Change-Id: I3cf386231e76b7505a691d006585918d343f6c96
parent 4d7990f4
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -349,8 +349,7 @@ static SkBitmap makeHwCompatible(const FormatInfo& format, const SkBitmap& sourc
    } else {
        SkBitmap bitmap;
        const SkImageInfo& info = source.info();
        bitmap.allocPixels(
                SkImageInfo::MakeN32(info.width(), info.height(), info.alphaType(), nullptr));
        bitmap.allocPixels(info.makeColorType(kN32_SkColorType));

        SkCanvas canvas(bitmap);
        canvas.drawColor(0);
@@ -416,7 +415,9 @@ void HardwareBitmapUploader::initialize() {
}

void HardwareBitmapUploader::terminate() {
    if (sUploader) {
        sUploader->destroy();
    }
}

}  // namespace android::uirenderer