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

Commit 0a78ce67 authored by Romain Guy's avatar Romain Guy Committed by android-build-merger
Browse files

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

am: c025347c

Change-Id: I67be64383eeac28ea84ae02a351a92d078b4dac8
parents e97fb9f8 c025347c
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);
    }
}