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
This commit is contained in:
@@ -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() {
|
||||
sUploader->destroy();
|
||||
if (sUploader) {
|
||||
sUploader->destroy();
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace android::uirenderer
|
||||
|
||||
Reference in New Issue
Block a user