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 /libkmstest | |
parent | c77756c48d6f38c8b40a39fd53f610c296530adf (diff) |
Add DumbFramebuffer
Move the current Framebuffer to DumbFramebuffer, and make a simple
Framebuffer as its super class.
Diffstat (limited to 'libkmstest')
-rw-r--r-- | libkmstest/conv.cpp | 14 | ||||
-rw-r--r-- | libkmstest/conv.h | 4 | ||||
-rw-r--r-- | libkmstest/testpat.cpp | 8 | ||||
-rw-r--r-- | libkmstest/testpat.h | 2 |
4 files changed, 14 insertions, 14 deletions
diff --git a/libkmstest/conv.cpp b/libkmstest/conv.cpp index d439253..b716020 100644 --- a/libkmstest/conv.cpp +++ b/libkmstest/conv.cpp @@ -1,13 +1,13 @@ #include <drm_fourcc.h> #include <stdexcept> -#include "framebuffer.h" +#include "dumbframebuffer.h" #include "color.h" #include "conv.h" namespace kms { -static RGB read_rgb(const Framebuffer& fb, int x, int y) +static RGB read_rgb(const DumbFramebuffer& fb, int x, int y) { uint32_t *pc = (uint32_t *)(fb.map(0) + fb.stride(0) * y); @@ -16,13 +16,13 @@ static RGB read_rgb(const Framebuffer& fb, int x, int y) return RGB((c >> 16) & 0xff, (c >> 8) & 0xff, c & 0xff); } -static YUV read_rgb_as_yuv(const Framebuffer& fb, int x, int y) +static YUV read_rgb_as_yuv(const DumbFramebuffer& fb, int x, int y) { RGB rgb = read_rgb(fb, x, y); return YUV(rgb); } -static void fb_rgb_to_packed_yuv(Framebuffer& dst_fb, const Framebuffer& src_fb) +static void fb_rgb_to_packed_yuv(DumbFramebuffer& dst_fb, const DumbFramebuffer& src_fb) { unsigned w = src_fb.width(); unsigned h = src_fb.height(); @@ -57,7 +57,7 @@ static void fb_rgb_to_packed_yuv(Framebuffer& dst_fb, const Framebuffer& src_fb) } } -static void fb_rgb_to_semiplanar_yuv(Framebuffer& dst_fb, const Framebuffer& src_fb) +static void fb_rgb_to_semiplanar_yuv(DumbFramebuffer& dst_fb, const DumbFramebuffer& src_fb) { unsigned w = src_fb.width(); unsigned h = src_fb.height(); @@ -92,7 +92,7 @@ static void fb_rgb_to_semiplanar_yuv(Framebuffer& dst_fb, const Framebuffer& src } } -static void fb_rgb_to_rgb565(Framebuffer& dst_fb, const Framebuffer& src_fb) +static void fb_rgb_to_rgb565(DumbFramebuffer& dst_fb, const DumbFramebuffer& src_fb) { unsigned w = src_fb.width(); unsigned h = src_fb.height(); @@ -114,7 +114,7 @@ static void fb_rgb_to_rgb565(Framebuffer& dst_fb, const Framebuffer& src_fb) } } -void color_convert(Framebuffer& dst, const Framebuffer &src) +void color_convert(DumbFramebuffer& dst, const DumbFramebuffer &src) { switch (dst.format()) { case DRM_FORMAT_NV12: diff --git a/libkmstest/conv.h b/libkmstest/conv.h index d1b306a..105aaf0 100644 --- a/libkmstest/conv.h +++ b/libkmstest/conv.h @@ -2,7 +2,7 @@ namespace kms { -class Framebuffer; +class DumbFramebuffer; -void color_convert(Framebuffer& dst, const Framebuffer &src); +void color_convert(DumbFramebuffer& dst, const DumbFramebuffer &src); } diff --git a/libkmstest/testpat.cpp b/libkmstest/testpat.cpp index 56000f1..958d785 100644 --- a/libkmstest/testpat.cpp +++ b/libkmstest/testpat.cpp @@ -10,7 +10,7 @@ #include <drm_mode.h> #include "card.h" -#include "framebuffer.h" +#include "dumbframebuffer.h" #include "testpat.h" #include "color.h" @@ -18,7 +18,7 @@ namespace kms { -static void draw_pixel(Framebuffer& buf, unsigned x, unsigned y, RGB color) +static void draw_pixel(DumbFramebuffer& buf, unsigned x, unsigned y, RGB color) { static RGB c1; @@ -74,7 +74,7 @@ static void draw_pixel(Framebuffer& buf, unsigned x, unsigned y, RGB color) } } -static void draw_rgb_test_pattern(Framebuffer& fb) +static void draw_rgb_test_pattern(DumbFramebuffer& fb) { unsigned x, y; unsigned w = fb.width(); @@ -146,7 +146,7 @@ static void draw_rgb_test_pattern(Framebuffer& fb) } } -void draw_test_pattern(Framebuffer& fb) +void draw_test_pattern(DumbFramebuffer& fb) { using namespace std::chrono; diff --git a/libkmstest/testpat.h b/libkmstest/testpat.h index b60271a..e051f4a 100644 --- a/libkmstest/testpat.h +++ b/libkmstest/testpat.h @@ -2,5 +2,5 @@ namespace kms { -void draw_test_pattern(Framebuffer& fb); +void draw_test_pattern(DumbFramebuffer& fb); } |