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

Commit c025347c authored by Romain Guy's avatar Romain Guy Committed by Android (Google) Code Review
Browse files

Merge "Fix CTS : BitmapRGBAF16Test#testSetPixel failure" into oc-dr1-dev

parents 4ab7b364 8ab1b6f8
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -328,11 +328,12 @@ static void FromColor_F16_Raw(void* dst, const SkColor src[], int width,
    uint64_t* d = (uint64_t*)dst;

    for (int i = 0; i < width; i++) {
        const float* color = SkColor4f::FromColor(*src++).vec();
        const SkColor4f color = SkColor4f::FromColor(*src++);
        uint16_t* scratch = reinterpret_cast<uint16_t*>(d++);
        for (int i = 0; i < 4; ++i) {
            scratch[i] = SkFloatToHalf(color[i]);
        }
        scratch[0] = SkFloatToHalf(color.fR);
        scratch[1] = SkFloatToHalf(color.fG);
        scratch[2] = SkFloatToHalf(color.fB);
        scratch[3] = SkFloatToHalf(color.fA);
    }
}