diff options
author | Tomi Valkeinen <tomi.valkeinen@iki.fi> | 2015-10-02 21:27:43 +0300 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@iki.fi> | 2015-10-03 16:59:19 +0300 |
commit | 89bfd9d567ced945bf2f4b3a927426c1ad2ee762 (patch) | |
tree | c6d3e5450196f11bb5c58ce1c7c92956ff8c1fb7 /tests | |
parent | c77756c48d6f38c8b40a39fd53f610c296530adf (diff) |
Add DumbFramebuffer
Move the current Framebuffer to DumbFramebuffer, and make a simple
Framebuffer as its super class.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/db.cpp | 18 | ||||
-rw-r--r-- | tests/testpat.cpp | 4 |
2 files changed, 11 insertions, 11 deletions
diff --git a/tests/db.cpp b/tests/db.cpp index d70f917..47ed273 100644 --- a/tests/db.cpp +++ b/tests/db.cpp @@ -12,14 +12,14 @@ using namespace std; using namespace kms; -static void draw_color_bar(Framebuffer& buf, int old_xpos, int xpos, int width); +static void draw_color_bar(DumbFramebuffer& buf, int old_xpos, int xpos, int width); static void main_loop(Card& card); class OutputFlipHandler { public: - OutputFlipHandler(Connector* conn, Crtc* crtc, Framebuffer* fb1, Framebuffer* fb2) + OutputFlipHandler(Connector* conn, Crtc* crtc, DumbFramebuffer* fb1, DumbFramebuffer* fb2) : m_connector(conn), m_crtc(crtc), m_fbs { fb1, fb2 }, m_front_buf(1), m_bar_xpos(0) { } @@ -84,7 +84,7 @@ public: private: Connector* m_connector; Crtc* m_crtc; - Framebuffer* m_fbs[2]; + DumbFramebuffer* m_fbs[2]; int m_front_buf; int m_bar_xpos; @@ -108,8 +108,8 @@ int main() auto mode = conn->get_default_mode(); - auto fb1 = new Framebuffer(card, mode.hdisplay, mode.vdisplay, "XR24"); - auto fb2 = new Framebuffer(card, mode.hdisplay, mode.vdisplay, "XR24"); + auto fb1 = new DumbFramebuffer(card, mode.hdisplay, mode.vdisplay, "XR24"); + auto fb2 = new DumbFramebuffer(card, mode.hdisplay, mode.vdisplay, "XR24"); printf("conn %u, crtc %u, fb1 %u, fb2 %u\n", conn->id(), crtc->id(), fb1->id(), fb2->id()); @@ -207,7 +207,7 @@ static const uint16_t colors16[] = { colors32[11].rgb565(), }; -static void drm_draw_color_bar_rgb888(Framebuffer& buf, int old_xpos, int xpos, int width) +static void drm_draw_color_bar_rgb888(DumbFramebuffer& buf, int old_xpos, int xpos, int width) { for (unsigned y = 0; y < buf.height(); ++y) { RGB bcol = colors32[y * ARRAY_SIZE(colors32) / buf.height()]; @@ -223,7 +223,7 @@ static void drm_draw_color_bar_rgb888(Framebuffer& buf, int old_xpos, int xpos, } } -static void drm_draw_color_bar_rgb565(Framebuffer& buf, int old_xpos, int xpos, int width) +static void drm_draw_color_bar_rgb565(DumbFramebuffer& buf, int old_xpos, int xpos, int width) { static_assert(ARRAY_SIZE(colors32) == ARRAY_SIZE(colors16), "bad colors arrays"); @@ -241,7 +241,7 @@ static void drm_draw_color_bar_rgb565(Framebuffer& buf, int old_xpos, int xpos, } } -static void drm_draw_color_bar_semiplanar_yuv(Framebuffer& buf, int old_xpos, int xpos, int width) +static void drm_draw_color_bar_semiplanar_yuv(DumbFramebuffer& buf, int old_xpos, int xpos, int width) { const uint8_t colors[] = { 0xff, @@ -269,7 +269,7 @@ static void drm_draw_color_bar_semiplanar_yuv(Framebuffer& buf, int old_xpos, in } } -static void draw_color_bar(Framebuffer& buf, int old_xpos, int xpos, int width) +static void draw_color_bar(DumbFramebuffer& buf, int old_xpos, int xpos, int width) { switch (buf.format()) { case DRM_FORMAT_NV12: diff --git a/tests/testpat.cpp b/tests/testpat.cpp index eaf1091..02f195a 100644 --- a/tests/testpat.cpp +++ b/tests/testpat.cpp @@ -30,7 +30,7 @@ int main() auto mode = conn->get_default_mode(); - auto fb = new Framebuffer(card, mode.hdisplay, mode.vdisplay, "XR24"); + auto fb = new DumbFramebuffer(card, mode.hdisplay, mode.vdisplay, "XR24"); draw_test_pattern(*fb); fbs.push_back(fb); @@ -54,7 +54,7 @@ int main() } if (plane) { - auto planefb = new Framebuffer(card, 400, 400, "YUYV"); + auto planefb = new DumbFramebuffer(card, 400, 400, "YUYV"); draw_test_pattern(*planefb); fbs.push_back(planefb); |