support 16 bits, 32 bits color, framebuffer map; remove redundant files

This commit is contained in:
idea4good
2017-12-13 22:29:28 +08:00
parent 50b144b4c8
commit 565ef43706
43 changed files with 590 additions and 1096 deletions

View File

@@ -32,15 +32,16 @@ class c_display;
class c_surface {
friend class c_display;
public:
c_surface(c_display* display, void* phy_fb, unsigned int width, unsigned int height);
virtual void set_pixel(int x, int y, unsigned int rgb, unsigned int z_order);
virtual void fill_rect(int x0, int y0, int x1, int y1, unsigned int rgb, unsigned int z_order);
virtual unsigned int get_pixel(int x, int y, unsigned int z_order);
void set_pixel(int x, int y, unsigned int rgb, unsigned int z_order);
unsigned int get_pixel(int x, int y, unsigned int z_order);
int get_width() { return m_width; }
int get_height() { return m_height; }
void draw_hline(int x0, int x1, int y, unsigned int rgb, unsigned int z_order);
void draw_vline(int x, int y0, int y1, unsigned int rgb, unsigned int z_order);
void draw_line(int x0, int y0, int x1, int y1, unsigned int rgb, unsigned int z_order);
void draw_rect(int x0, int y0, int x1, int y1, unsigned int rgb, unsigned int z_order);
void fill_rect(int x0, int y0, int x1, int y1, unsigned int rgb, unsigned int z_order);
void draw_custom_shape(int l, int t, int r, int b, unsigned int color, const CUSTOM_SHAPE pRgn[], int z_order);
int flush_scrren(int left, int top, int right, int bottom);
@@ -50,14 +51,16 @@ public:
int set_frame_layer(c_rect& rect, unsigned int z_order);
void set_active(bool flag){m_is_active = flag;}
private:
protected:
virtual void set_pixel_on_fb(int x, int y, unsigned int rgb);
virtual void fill_rect_on_fb(int x0, int y0, int x1, int y1, unsigned int rgb);
void set_surface(void* wnd_root, Z_ORDER_LEVEL max_z_order);
int copy_layer_pixel_2_fb(int x, int y, unsigned int z_order);
void do_quick_set_pixel(int x,int y,unsigned int rgb);
void do_quick_fill_rect(int x0, int y0, int x1, int y1, unsigned int rgb);
unsigned int m_width; //in pixels
unsigned int m_height; //in pixels
c_surface(c_display* display, void* phy_fb, unsigned int width, unsigned int height, unsigned int color_bytes);
int m_width; //in pixels
int m_height; //in pixels
int m_color_bytes; //16 bits, 32 bits only
void* m_fb;
struct FRAME_LAYER m_frame_layers[Z_ORDER_LEVEL_MAX];
void* m_usr;
@@ -68,4 +71,14 @@ private:
c_display* m_display;
};
class c_surface_16bits : public c_surface {
friend class c_display;
c_surface_16bits(c_display* display, void* phy_fb, unsigned int width, unsigned int height, unsigned int color_bytes) :
c_surface(display, phy_fb, width, height, color_bytes) {};
virtual void set_pixel(int x, int y, unsigned int rgb, unsigned int z_order);
virtual void set_pixel_on_fb(int x, int y, unsigned int rgb);
virtual void fill_rect(int x0, int y0, int x1, int y1, unsigned int rgb, unsigned int z_order);
virtual void fill_rect_on_fb(int x0, int y0, int x1, int y1, unsigned int rgb);
virtual unsigned int get_pixel(int x, int y, unsigned int z_order);
};
#endif