[fb] Change to embedding PSF file

Moved old PSF parsing code from kernel, and switched to embedding whole
PSF instead of just glyph data to make font class the same code paths
for both cases.
This commit is contained in:
Justin C. Miller
2021-01-03 00:08:20 -08:00
parent 6af29a7181
commit dccb136c99
16 changed files with 553 additions and 655 deletions

28
src/drivers/fb/screen.h Normal file
View File

@@ -0,0 +1,28 @@
#pragma once
#include <stddef.h>
#include <stdint.h>
class screen
{
public:
using pixel_t = uint32_t;
enum class pixel_order : uint8_t { bgr8, rgb8, };
screen(void *addr, unsigned hres, unsigned vres, pixel_order order);
unsigned width() const { return m_resx; }
unsigned height() const { return m_resy; }
pixel_t color(uint8_t r, uint8_t g, uint8_t b) const;
void fill(pixel_t color);
void draw_pixel(unsigned x, unsigned y, pixel_t color);
private:
pixel_t *m_fb;
pixel_order m_order;
unsigned m_resx, m_resy;
screen() = delete;
};