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

Commit 87e99a29 authored by Leon Scroggins III's avatar Leon Scroggins III Committed by Leon Scroggins
Browse files

Ensure that hardware Bitmap has a ColorSpace

Bug: 129355537
Test: I9e004fbb7c966bb58ae374087fecd66a1bb72346

android_view_ThreadedRenderer_createHardwareBitmapFromRenderNode in
SkiaGL could create an android::Bitmap without an SkColorSpace. Treat
HAL_DATASPACE_UNKNOWN as sRGB, as this is how we treat it internally.

Change-Id: Iad7f7d7cafce0a8759a84a4296ae5c3ce86dff4c
(cherry picked from commit 7fb4c9e4)
Merged-In: Iad7f7d7cafce0a8759a84a4296ae5c3ce86dff4c
parent db54f27d
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -60,6 +60,9 @@ SkColorType PixelFormatToColorType(android::PixelFormat format) {
}

sk_sp<SkColorSpace> DataSpaceToColorSpace(android_dataspace dataspace) {
    if (dataspace == HAL_DATASPACE_UNKNOWN) {
        return SkColorSpace::MakeSRGB();
    }

    skcms_Matrix3x3 gamut;
    switch (dataspace & HAL_DATASPACE_STANDARD_MASK) {