]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - android/external-libkmsxx.git/commitdiff
Fix byte order of 24-bit formats.
authorJyri Sarha <jsarha@ti.com>
Mon, 15 Aug 2016 13:17:49 +0000 (16:17 +0300)
committerJyri Sarha <jsarha@ti.com>
Mon, 15 Aug 2016 14:31:38 +0000 (17:31 +0300)
kms++util/src/drawing.cpp

index 44634e170683d6a68bf7fc66dc2e5b719d4e98f2..f8cc03fb56413a17469f25134f2503cb10e77a3c 100644 (file)
@@ -26,17 +26,17 @@ void draw_rgb_pixel(IMappedFramebuffer& buf, unsigned x, unsigned y, RGB color)
        case PixelFormat::RGB888:
        {
                uint8_t *p = buf.map(0) + buf.stride(0) * y + x * 3;
-               p[0] = color.r;
+               p[0] = color.b;
                p[1] = color.g;
-               p[2] = color.b;
+               p[2] = color.r;
                break;
        }
        case PixelFormat::BGR888:
        {
                uint8_t *p = buf.map(0) + buf.stride(0) * y + x * 3;
-               p[0] = color.b;
+               p[0] = color.r;
                p[1] = color.g;
-               p[2] = color.r;
+               p[2] = color.b;
                break;
        }
        case PixelFormat::RGB565: