2017-12-06 21:43:47 +08:00
|
|
|
#ifndef _DISPLAY_H_
|
|
|
|
#define _DISPLAY_H_
|
|
|
|
|
|
|
|
#define SURFACE_CNT_MAX 6//root + pages
|
|
|
|
|
|
|
|
class c_hid_pipe;
|
|
|
|
class c_surface;
|
|
|
|
|
|
|
|
class c_display {
|
2018-12-17 15:51:00 +08:00
|
|
|
friend class c_surface;
|
2017-12-06 21:43:47 +08:00
|
|
|
public:
|
2017-12-13 22:29:28 +08:00
|
|
|
c_display(void* phy_fb, unsigned int display_width, unsigned int display_height,
|
|
|
|
unsigned int surface_width, unsigned int surface_height,
|
2019-01-21 15:27:11 +08:00
|
|
|
unsigned int color_bytes, unsigned int surface_cnt, EXTERNAL_GFX_OP* gfx_op = NULL);
|
2018-12-02 22:39:43 +08:00
|
|
|
c_surface* alloc_surface(void* usr, Z_ORDER_LEVEL max_zorder);
|
2017-12-13 22:29:28 +08:00
|
|
|
int merge_surface(c_surface* s1, c_surface* s2, int x0, int x1, int y0, int y2, int offset);
|
2017-12-06 21:43:47 +08:00
|
|
|
unsigned int get_width() { return m_width; }
|
|
|
|
unsigned int get_height() { return m_height; }
|
|
|
|
|
2018-12-17 15:51:00 +08:00
|
|
|
void* get_updated_fb(int* width, int* height, bool force_update = false);
|
2018-12-11 14:30:09 +08:00
|
|
|
int snap_shot(const char* file_name);
|
2017-12-06 21:43:47 +08:00
|
|
|
private:
|
2017-12-13 22:29:28 +08:00
|
|
|
unsigned int m_width; //in pixels
|
|
|
|
unsigned int m_height; //in pixels
|
|
|
|
unsigned int m_color_bytes; //16 bits, 32 bits only
|
2017-12-06 21:43:47 +08:00
|
|
|
void* m_phy_fb;
|
2018-12-17 15:51:00 +08:00
|
|
|
int m_phy_read_index;
|
|
|
|
int m_phy_write_index;
|
2017-12-06 21:43:47 +08:00
|
|
|
c_surface* m_surface_group[SURFACE_CNT_MAX];
|
|
|
|
unsigned int m_surface_cnt;
|
|
|
|
};
|
|
|
|
#endif
|