From 34e63f641195019e903104c8b9e6eb855efeee2c Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Thu, 16 Jun 2016 17:59:07 +0300 Subject: Support RGB888 --- kms++util/src/drawing.cpp | 9 +++++++++ kms++util/src/testpat.cpp | 1 + 2 files changed, 10 insertions(+) (limited to 'kms++util') diff --git a/kms++util/src/drawing.cpp b/kms++util/src/drawing.cpp index cb6fbf6..157c799 100644 --- a/kms++util/src/drawing.cpp +++ b/kms++util/src/drawing.cpp @@ -23,6 +23,14 @@ void draw_rgb_pixel(IMappedFramebuffer& buf, unsigned x, unsigned y, RGB color) *p = color.abgr8888(); break; } + case PixelFormat::RGB888: + { + uint8_t *p = buf.map(0) + buf.stride(0) * y + x * 3; + p[0] = color.r; + p[1] = color.g; + p[2] = color.b; + break; + } case PixelFormat::RGB565: { uint16_t *p = (uint16_t*)(buf.map(0) + buf.stride(0) * y + x * 2); @@ -150,6 +158,7 @@ static void draw_char(IMappedFramebuffer& buf, uint32_t xpos, uint32_t ypos, cha case PixelFormat::XBGR8888: case PixelFormat::ARGB8888: case PixelFormat::ABGR8888: + case PixelFormat::RGB888: case PixelFormat::RGB565: for (y = 0; y < 8; y++) { for (x = 0; x < 8; x++) { diff --git a/kms++util/src/testpat.cpp b/kms++util/src/testpat.cpp index cbe611d..1297e61 100644 --- a/kms++util/src/testpat.cpp +++ b/kms++util/src/testpat.cpp @@ -104,6 +104,7 @@ static void draw_test_pattern_part(IMappedFramebuffer& fb, unsigned start_y, uns case PixelFormat::XBGR8888: case PixelFormat::ARGB8888: case PixelFormat::ABGR8888: + case PixelFormat::RGB888: case PixelFormat::RGB565: for (y = start_y; y < end_y; y++) { for (x = 0; x < w; x++) { -- cgit v1.2.3