From fab9bb700372008130e5026fa9fe5fd22ac6ec4e Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Tue, 3 Oct 2017 12:32:52 +0300 Subject: Rework framebuffer classes Drop (I)MappedFramebuffer, as it doesn't really provide any value, and have most of the methods be present in IFramebuffer with default exception throwing implementation. This gives us simpler way to use the framebuffers, as almost always we can just use a pointer to IFramebuffer. --- utils/kmstest.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'utils') diff --git a/utils/kmstest.cpp b/utils/kmstest.cpp index ba7d790..63b7d44 100644 --- a/utils/kmstest.cpp +++ b/utils/kmstest.cpp @@ -30,7 +30,7 @@ struct PlaneInfo unsigned view_w; unsigned view_h; - vector fbs; + vector fbs; }; struct OutputInfo @@ -41,7 +41,7 @@ struct OutputInfo Plane* primary_plane; Videomode mode; bool user_set_crtc; - vector fbs; + vector fbs; vector planes; }; @@ -288,9 +288,9 @@ static void parse_plane(Card& card, const string& plane_str, const OutputInfo& o pinfo.y = output.mode.vdisplay / 2 - pinfo.h / 2; } -static vector get_default_fb(Card& card, unsigned width, unsigned height) +static vector get_default_fb(Card& card, unsigned width, unsigned height) { - vector v; + vector v; for (unsigned i = 0; i < s_num_buffers; ++i) v.push_back(new DumbFramebuffer(card, width, height, PixelFormat::XRGB8888)); @@ -298,7 +298,7 @@ static vector get_default_fb(Card& card, unsigned width, uns return v; } -static vector parse_fb(Card& card, const string& fb_str, unsigned def_w, unsigned def_h) +static vector parse_fb(Card& card, const string& fb_str, unsigned def_w, unsigned def_h) { unsigned w = def_w; unsigned h = def_h; @@ -323,7 +323,7 @@ static vector parse_fb(Card& card, const string& fb_str, uns format = FourCCToPixelFormat(sm[3]); } - vector v; + vector v; for (unsigned i = 0; i < s_num_buffers; ++i) v.push_back(new DumbFramebuffer(card, w, h, format)); @@ -883,12 +883,12 @@ private: queue_next(); } - static unsigned get_bar_pos(MappedFramebuffer* fb, unsigned frame_num) + static unsigned get_bar_pos(Framebuffer* fb, unsigned frame_num) { return (frame_num * bar_speed) % (fb->width() - bar_width + 1); } - static void draw_bar(MappedFramebuffer* fb, unsigned frame_num) + static void draw_bar(Framebuffer* fb, unsigned frame_num) { int old_xpos = frame_num < s_num_buffers ? -1 : get_bar_pos(fb, frame_num - s_num_buffers); int new_xpos = get_bar_pos(fb, frame_num); -- cgit v1.2.3