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

Commit fca60966 authored by Alec Mouri's avatar Alec Mouri
Browse files

Support BGRA1010102 in bytesPerPixel()

Bug: 431746508
Flag: EXEMPT bug fix for new hal format
Test: adb screencap
Change-Id: Ib821aa684a59f4b5dfa09d5d5ca98a52e98d0fb7
parent 2a09a93f
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ uint32_t bytesPerPixel(PixelFormat format) {
        case PIXEL_FORMAT_RGBX_8888:
        case PIXEL_FORMAT_BGRA_8888:
        case PIXEL_FORMAT_RGBA_1010102:
        case PIXEL_FORMAT_BGRA_1010102:
            return 4;
        case PIXEL_FORMAT_RGB_888:
            return 3;
@@ -38,9 +39,12 @@ uint32_t bytesPerPixel(PixelFormat format) {
        case PIXEL_FORMAT_R_8:
            return 1;
    }

    return 0;
}



// ----------------------------------------------------------------------------
}; // namespace android
// ----------------------------------------------------------------------------
+2 −0
Original line number Diff line number Diff line
@@ -66,6 +66,8 @@ enum {
    PIXEL_FORMAT_R_16_UINT     = 0x39,
    PIXEL_FORMAT_RG_1616_UINT  = 0x3a,
    PIXEL_FORMAT_RGBA_10101010 = 0x3b,
    // we really need to kill this off >_>
    PIXEL_FORMAT_BGRA_1010102  = 0x43,
};

typedef int32_t PixelFormat;