summaryrefslogtreecommitdiff
path: root/kms++util/src/drawing.cpp
diff options
context:
space:
mode:
authorJyri Sarha <jsarha@ti.com>2016-08-15 16:17:49 +0300
committerJyri Sarha <jsarha@ti.com>2016-08-15 17:31:38 +0300
commit13883ffaa3e04c4ab465581127411feb4dce1b89 (patch)
tree2ceb8a9571ecb21c7078595f8d887957ef14b3e5 /kms++util/src/drawing.cpp
parent235afbde971e6f5deea6b7a78d64b75614e18cab (diff)
Fix byte order of 24-bit formats.
Diffstat (limited to 'kms++util/src/drawing.cpp')
-rw-r--r--kms++util/src/drawing.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/kms++util/src/drawing.cpp b/kms++util/src/drawing.cpp
index 44634e1..f8cc03f 100644
--- a/kms++util/src/drawing.cpp
+++ b/kms++util/src/drawing.cpp
@@ -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: