mirror of
https://github.com/lvgl/lvgl.git
synced 2024-12-18 05:53:55 +08:00
fix(disp): change all disp_buf to draw_buf
follow up the commit:
commit e9cc1c2d46
Author: Gabor Kiss-Vamosi <kisvegabor@gmail.com>
Date: Wed Mar 10 13:07:15 2021 +0100
feat(driver): raname lv_disp_buf_t to lv_disp_draw_buf_t + save only the drv's pointer in lv_disp_t
This commit is contained in:
parent
1da95cf534
commit
1f3ae7f274
@ -11,7 +11,7 @@ TFT_eSPI tft = TFT_eSPI(); /* TFT instance */
|
|||||||
static uint32_t screenWidth = 320;
|
static uint32_t screenWidth = 320;
|
||||||
static uint32_t screenHeight = 240;
|
static uint32_t screenHeight = 240;
|
||||||
|
|
||||||
static lv_disp_buf_t disp_buf;
|
static lv_draw_buf_t draw_buf;
|
||||||
static lv_color_t buf[screenWidth * 10];
|
static lv_color_t buf[screenWidth * 10];
|
||||||
|
|
||||||
#if LV_USE_LOG != 0
|
#if LV_USE_LOG != 0
|
||||||
@ -82,7 +82,7 @@ void setup()
|
|||||||
uint16_t calData[5] = {275, 3620, 264, 3532, 1};
|
uint16_t calData[5] = {275, 3620, 264, 3532, 1};
|
||||||
tft.setTouch(calData);
|
tft.setTouch(calData);
|
||||||
|
|
||||||
lv_disp_buf_init(&disp_buf, buf, NULL, screenWidth * 10);
|
lv_draw_buf_init(&draw_buf, buf, NULL, screenWidth * 10);
|
||||||
|
|
||||||
/* Initialize the display */
|
/* Initialize the display */
|
||||||
lv_disp_drv_t disp_drv;
|
lv_disp_drv_t disp_drv;
|
||||||
@ -91,7 +91,7 @@ void setup()
|
|||||||
disp_drv.hor_res = screenWidth;
|
disp_drv.hor_res = screenWidth;
|
||||||
disp_drv.ver_res = screenHeight;
|
disp_drv.ver_res = screenHeight;
|
||||||
disp_drv.flush_cb = my_disp_flush;
|
disp_drv.flush_cb = my_disp_flush;
|
||||||
disp_drv.buffer = &disp_buf;
|
disp_drv.draw_buf = &draw_buf;
|
||||||
lv_disp_drv_register(&disp_drv);
|
lv_disp_drv_register(&disp_drv);
|
||||||
|
|
||||||
/* Initialize the (dummy) input device driver */
|
/* Initialize the (dummy) input device driver */
|
||||||
|
@ -75,21 +75,21 @@ void lv_port_disp_init(void)
|
|||||||
* */
|
* */
|
||||||
|
|
||||||
/* Example for 1) */
|
/* Example for 1) */
|
||||||
static lv_disp_buf_t draw_buf_dsc_1;
|
static lv_draw_buf_t draw_buf_dsc_1;
|
||||||
static lv_color_t draw_buf_1[MY_DISP_HOR_RES * 10]; /*A buffer for 10 rows*/
|
static lv_color_t buf_1[MY_DISP_HOR_RES * 10]; /*A buffer for 10 rows*/
|
||||||
lv_disp_buf_init(&draw_buf_dsc_1, draw_buf_1, NULL, MY_DISP_HOR_RES * 10); /*Initialize the display buffer*/
|
lv_draw_buf_init(&draw_buf_dsc_1, buf_1, NULL, MY_DISP_HOR_RES * 10); /*Initialize the display buffer*/
|
||||||
|
|
||||||
/* Example for 2) */
|
/* Example for 2) */
|
||||||
static lv_disp_buf_t draw_buf_dsc_2;
|
static lv_draw_buf_t draw_buf_dsc_2;
|
||||||
static lv_color_t draw_buf_2_1[MY_DISP_HOR_RES * 10]; /*A buffer for 10 rows*/
|
static lv_color_t buf_2_1[MY_DISP_HOR_RES * 10]; /*A buffer for 10 rows*/
|
||||||
static lv_color_t draw_buf_2_1[MY_DISP_HOR_RES * 10]; /*An other buffer for 10 rows*/
|
static lv_color_t buf_2_1[MY_DISP_HOR_RES * 10]; /*An other buffer for 10 rows*/
|
||||||
lv_disp_buf_init(&draw_buf_dsc_2, draw_buf_2_1, draw_buf_2_1, MY_DISP_HOR_RES * 10); /*Initialize the display buffer*/
|
lv_draw_buf_init(&draw_buf_dsc_2, buf_2_1, buf_2_1, MY_DISP_HOR_RES * 10); /*Initialize the display buffer*/
|
||||||
|
|
||||||
/* Example for 3) */
|
/* Example for 3) */
|
||||||
static lv_disp_buf_t draw_buf_dsc_3;
|
static lv_draw_buf_t draw_buf_dsc_3;
|
||||||
static lv_color_t draw_buf_3_1[MY_DISP_HOR_RES * MY_DISP_VER_RES]; /*A screen sized buffer*/
|
static lv_color_t buf_3_1[MY_DISP_HOR_RES * MY_DISP_VER_RES]; /*A screen sized buffer*/
|
||||||
static lv_color_t draw_buf_3_1[MY_DISP_HOR_RES * MY_DISP_VER_RES]; /*An other screen sized buffer*/
|
static lv_color_t buf_3_1[MY_DISP_HOR_RES * MY_DISP_VER_RES]; /*An other screen sized buffer*/
|
||||||
lv_disp_buf_init(&draw_buf_dsc_3, draw_buf_3_1, draw_buf_3_2, MY_DISP_VER_RES * LV_VER_RES_MAX); /*Initialize the display buffer*/
|
lv_draw_buf_init(&draw_buf_dsc_3, buf_3_1, buf_3_2, MY_DISP_VER_RES * LV_VER_RES_MAX); /*Initialize the display buffer*/
|
||||||
|
|
||||||
/*-----------------------------------
|
/*-----------------------------------
|
||||||
* Register the display in LVGL
|
* Register the display in LVGL
|
||||||
@ -108,7 +108,7 @@ void lv_port_disp_init(void)
|
|||||||
disp_drv.flush_cb = disp_flush;
|
disp_drv.flush_cb = disp_flush;
|
||||||
|
|
||||||
/*Set a display buffer*/
|
/*Set a display buffer*/
|
||||||
disp_drv.buffer = &draw_buf_dsc_1;
|
disp_drv.draw_buf = &draw_buf_dsc_1;
|
||||||
|
|
||||||
#if LV_USE_GPU
|
#if LV_USE_GPU
|
||||||
/*Fill a memory array with a color*/
|
/*Fill a memory array with a color*/
|
||||||
|
@ -343,7 +343,7 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_map(const lv_area_t * map_area, const
|
|||||||
lv_area_t draw_area;
|
lv_area_t draw_area;
|
||||||
lv_area_copy(&draw_area, clip_area);
|
lv_area_copy(&draw_area, clip_area);
|
||||||
|
|
||||||
lv_disp_t * disp = _lv_refr_get_disp_refreshing();
|
lv_disp_t * disp = _lv_refr_get_disp_refreshing();
|
||||||
lv_disp_draw_buf_t * draw_buf = lv_disp_get_draw_buf(disp);
|
lv_disp_draw_buf_t * draw_buf = lv_disp_get_draw_buf(disp);
|
||||||
const lv_area_t * disp_area = &draw_buf->area;
|
const lv_area_t * disp_area = &draw_buf->area;
|
||||||
|
|
||||||
|
@ -670,17 +670,17 @@ static void draw_letter_subpx(lv_coord_t pos_x, lv_coord_t pos_y, lv_font_glyph_
|
|||||||
|
|
||||||
lv_color_t * color_buf = lv_mem_buf_get(mask_buf_size * sizeof(lv_color_t));
|
lv_color_t * color_buf = lv_mem_buf_get(mask_buf_size * sizeof(lv_color_t));
|
||||||
|
|
||||||
lv_disp_t * disp = _lv_refr_get_disp_refreshing();
|
lv_disp_t * disp = _lv_refr_get_disp_refreshing();
|
||||||
lv_disp_buf_t * draw_buf = lv_disp_get_draw_buf(disp);
|
lv_disp_buf_t * draw_buf = lv_disp_get_draw_buf(disp);
|
||||||
|
|
||||||
int32_t draw_buf_width = lv_area_get_width(&draw_buf->area);
|
int32_t disp_buf_width = lv_area_get_width(&draw_buf->area);
|
||||||
lv_color_t * draw_buf_buf_tmp = draw_buf->buf_act;
|
lv_color_t * disp_buf_buf_tmp = draw_buf->buf_act;
|
||||||
|
|
||||||
/*Set a pointer on draw_buf to the first pixel of the letter*/
|
/*Set a pointer on draw_buf to the first pixel of the letter*/
|
||||||
draw_buf_buf_tmp += ((pos_y - draw_buf->area.y1) * draw_buf_width) + pos_x - draw_buf->area.x1;
|
disp_buf_buf_tmp += ((pos_y - draw_buf->area.y1) * disp_buf_width) + pos_x - draw_buf->area.x1;
|
||||||
|
|
||||||
/*If the letter is partially out of mask the move there on draw_buf*/
|
/*If the letter is partially out of mask the move there on draw_buf*/
|
||||||
draw_buf_buf_tmp += (row_start * draw_buf_width) + col_start / 3;
|
disp_buf_buf_tmp += (row_start * disp_buf_width) + col_start / 3;
|
||||||
|
|
||||||
lv_area_t map_area;
|
lv_area_t map_area;
|
||||||
map_area.x1 = col_start / 3 + pos_x;
|
map_area.x1 = col_start / 3 + pos_x;
|
||||||
@ -727,11 +727,11 @@ static void draw_letter_subpx(lv_coord_t pos_x, lv_coord_t pos_y, lv_font_glyph_
|
|||||||
|
|
||||||
lv_color_t res_color;
|
lv_color_t res_color;
|
||||||
#if LV_COLOR_16_SWAP == 0
|
#if LV_COLOR_16_SWAP == 0
|
||||||
uint8_t bg_rgb[3] = {draw_buf_buf_tmp->ch.red, draw_buf_buf_tmp->ch.green, draw_buf_buf_tmp->ch.blue};
|
uint8_t bg_rgb[3] = {disp_buf_buf_tmp->ch.red, disp_buf_buf_tmp->ch.green, disp_buf_buf_tmp->ch.blue};
|
||||||
#else
|
#else
|
||||||
uint8_t bg_rgb[3] = {draw_buf_buf_tmp->ch.red,
|
uint8_t bg_rgb[3] = {disp_buf_buf_tmp->ch.red,
|
||||||
(draw_buf_buf_tmp->ch.green_h << 3) + draw_buf_buf_tmp->ch.green_l,
|
(disp_buf_buf_tmp->ch.green_h << 3) + disp_buf_buf_tmp->ch.green_l,
|
||||||
draw_buf_buf_tmp->ch.blue
|
disp_buf_buf_tmp->ch.blue
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -761,7 +761,7 @@ static void draw_letter_subpx(lv_coord_t pos_x, lv_coord_t pos_y, lv_font_glyph_
|
|||||||
|
|
||||||
/*Next mask byte*/
|
/*Next mask byte*/
|
||||||
mask_p++;
|
mask_p++;
|
||||||
draw_buf_buf_tmp++;
|
disp_buf_buf_tmp++;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Go to the next column*/
|
/*Go to the next column*/
|
||||||
@ -802,7 +802,7 @@ static void draw_letter_subpx(lv_coord_t pos_x, lv_coord_t pos_y, lv_font_glyph_
|
|||||||
col_bit = col_bit & 0x7;
|
col_bit = col_bit & 0x7;
|
||||||
|
|
||||||
/*Next row in draw_buf*/
|
/*Next row in draw_buf*/
|
||||||
draw_buf_buf_tmp += draw_buf_width - (col_end - col_start) / 3;
|
disp_buf_buf_tmp += disp_buf_width - (col_end - col_start) / 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Flush the last part*/
|
/*Flush the last part*/
|
||||||
|
@ -149,7 +149,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_line_hor(const lv_point_t * point1, const
|
|||||||
#if LV_DRAW_COMPLEX
|
#if LV_DRAW_COMPLEX
|
||||||
/*If there other mask apply it*/
|
/*If there other mask apply it*/
|
||||||
else {
|
else {
|
||||||
lv_disp_t * disp = _lv_refr_get_disp_refreshing();
|
lv_disp_t * disp = _lv_refr_get_disp_refreshing();
|
||||||
lv_disp_draw_buf_t * draw_buf = lv_disp_get_draw_buf(disp);
|
lv_disp_draw_buf_t * draw_buf = lv_disp_get_draw_buf(disp);
|
||||||
const lv_area_t * disp_area = &draw_buf->area;
|
const lv_area_t * disp_area = &draw_buf->area;
|
||||||
/* Get clipped fill area which is the real draw area.
|
/* Get clipped fill area which is the real draw area.
|
||||||
@ -250,7 +250,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_line_ver(const lv_point_t * point1, const
|
|||||||
#if LV_DRAW_COMPLEX
|
#if LV_DRAW_COMPLEX
|
||||||
/*If there other mask apply it*/
|
/*If there other mask apply it*/
|
||||||
else {
|
else {
|
||||||
lv_disp_t * disp = _lv_refr_get_disp_refreshing();
|
lv_disp_t * disp = _lv_refr_get_disp_refreshing();
|
||||||
lv_disp_draw_buf_t * draw_buf = lv_disp_get_draw_buf(disp);
|
lv_disp_draw_buf_t * draw_buf = lv_disp_get_draw_buf(disp);
|
||||||
const lv_area_t * disp_area = &draw_buf->area;
|
const lv_area_t * disp_area = &draw_buf->area;
|
||||||
/* Get clipped fill area which is the real draw area.
|
/* Get clipped fill area which is the real draw area.
|
||||||
@ -407,7 +407,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_line_skew(const lv_point_t * point1, cons
|
|||||||
mask_bottom_id = lv_draw_mask_add(&mask_bottom_param, NULL);
|
mask_bottom_id = lv_draw_mask_add(&mask_bottom_param, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
lv_disp_t * disp = _lv_refr_get_disp_refreshing();
|
lv_disp_t * disp = _lv_refr_get_disp_refreshing();
|
||||||
lv_disp_draw_buf_t * draw_buf = lv_disp_get_draw_buf(disp);
|
lv_disp_draw_buf_t * draw_buf = lv_disp_get_draw_buf(disp);
|
||||||
|
|
||||||
const lv_area_t * disp_area = &draw_buf->area;
|
const lv_area_t * disp_area = &draw_buf->area;
|
||||||
|
@ -139,7 +139,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_bg(const lv_area_t * coords, const lv_are
|
|||||||
|
|
||||||
if(opa > LV_OPA_MAX) opa = LV_OPA_COVER;
|
if(opa > LV_OPA_MAX) opa = LV_OPA_COVER;
|
||||||
|
|
||||||
lv_disp_t * disp = _lv_refr_get_disp_refreshing();
|
lv_disp_t * disp = _lv_refr_get_disp_refreshing();
|
||||||
lv_disp_draw_buf_t * draw_buf = lv_disp_get_draw_buf(disp);
|
lv_disp_draw_buf_t * draw_buf = lv_disp_get_draw_buf(disp);
|
||||||
|
|
||||||
/* Get clipped fill area which is the real draw area.
|
/* Get clipped fill area which is the real draw area.
|
||||||
@ -420,7 +420,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_border(const lv_area_t * coords, const lv
|
|||||||
lv_opa_t opa = dsc->border_opa;
|
lv_opa_t opa = dsc->border_opa;
|
||||||
if(opa > LV_OPA_MAX) opa = LV_OPA_COVER;
|
if(opa > LV_OPA_MAX) opa = LV_OPA_COVER;
|
||||||
|
|
||||||
lv_disp_t * disp = _lv_refr_get_disp_refreshing();
|
lv_disp_t * disp = _lv_refr_get_disp_refreshing();
|
||||||
lv_disp_draw_buf_t * draw_buf = lv_disp_get_draw_buf(disp);
|
lv_disp_draw_buf_t * draw_buf = lv_disp_get_draw_buf(disp);
|
||||||
|
|
||||||
/* Get clipped fill area which is the real draw area.
|
/* Get clipped fill area which is the real draw area.
|
||||||
@ -551,7 +551,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_shadow(const lv_area_t * coords, const lv
|
|||||||
|
|
||||||
if(opa > LV_OPA_MAX) opa = LV_OPA_COVER;
|
if(opa > LV_OPA_MAX) opa = LV_OPA_COVER;
|
||||||
|
|
||||||
lv_disp_t * disp = _lv_refr_get_disp_refreshing();
|
lv_disp_t * disp = _lv_refr_get_disp_refreshing();
|
||||||
lv_disp_draw_buf_t * draw_buf = lv_disp_get_draw_buf(disp);
|
lv_disp_draw_buf_t * draw_buf = lv_disp_get_draw_buf(disp);
|
||||||
|
|
||||||
/* Get clipped fill area which is the real draw area.
|
/* Get clipped fill area which is the real draw area.
|
||||||
@ -1285,7 +1285,7 @@ static void draw_full_border(const lv_area_t * area_inner, const lv_area_t * are
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
lv_disp_t * disp = _lv_refr_get_disp_refreshing();
|
lv_disp_t * disp = _lv_refr_get_disp_refreshing();
|
||||||
lv_disp_draw_buf_t * draw_buf = lv_disp_get_draw_buf(disp);
|
lv_disp_draw_buf_t * draw_buf = lv_disp_get_draw_buf(disp);
|
||||||
|
|
||||||
/* Get clipped fill area which is the real draw area.
|
/* Get clipped fill area which is the real draw area.
|
||||||
|
@ -66,7 +66,7 @@ void lv_disp_drv_init(lv_disp_drv_t * driver)
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize a display buffer
|
* Initialize a display buffer
|
||||||
* @param disp_buf pointer `lv_disp_buf_t` variable to initialize
|
* @param draw_buf pointer `lv_draw_buf_t` variable to initialize
|
||||||
* @param buf1 A buffer to be used by LVGL to draw the image.
|
* @param buf1 A buffer to be used by LVGL to draw the image.
|
||||||
* Always has to specified and can't be NULL.
|
* Always has to specified and can't be NULL.
|
||||||
* Can be an array allocated by the user. E.g. `static lv_color_t disp_buf1[1024 * 10]`
|
* Can be an array allocated by the user. E.g. `static lv_color_t disp_buf1[1024 * 10]`
|
||||||
@ -79,14 +79,14 @@ void lv_disp_drv_init(lv_disp_drv_t * driver)
|
|||||||
* sent. Set to `NULL` if unused.
|
* sent. Set to `NULL` if unused.
|
||||||
* @param size_in_px_cnt size of the `buf1` and `buf2` in pixel count.
|
* @param size_in_px_cnt size of the `buf1` and `buf2` in pixel count.
|
||||||
*/
|
*/
|
||||||
void lv_disp_draw_buf_init(lv_disp_draw_buf_t * disp_buf, void * buf1, void * buf2, uint32_t size_in_px_cnt)
|
void lv_disp_draw_buf_init(lv_disp_draw_buf_t * draw_buf, void * buf1, void * buf2, uint32_t size_in_px_cnt)
|
||||||
{
|
{
|
||||||
lv_memset_00(disp_buf, sizeof(lv_disp_draw_buf_t));
|
lv_memset_00(draw_buf, sizeof(lv_disp_draw_buf_t));
|
||||||
|
|
||||||
disp_buf->buf1 = buf1;
|
draw_buf->buf1 = buf1;
|
||||||
disp_buf->buf2 = buf2;
|
draw_buf->buf2 = buf2;
|
||||||
disp_buf->buf_act = disp_buf->buf1;
|
draw_buf->buf_act = draw_buf->buf1;
|
||||||
disp_buf->size = size_in_px_cnt;
|
draw_buf->size = size_in_px_cnt;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -198,7 +198,7 @@ void lv_disp_drv_init(lv_disp_drv_t * driver);
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize a display buffer
|
* Initialize a display buffer
|
||||||
* @param disp_buf pointer `lv_disp_buf_t` variable to initialize
|
* @param draw_buf pointer `lv_draw_buf_t` variable to initialize
|
||||||
* @param buf1 A buffer to be used by LVGL to draw the image.
|
* @param buf1 A buffer to be used by LVGL to draw the image.
|
||||||
* Always has to specified and can't be NULL.
|
* Always has to specified and can't be NULL.
|
||||||
* Can be an array allocated by the user. E.g. `static lv_color_t disp_buf1[1024 * 10]`
|
* Can be an array allocated by the user. E.g. `static lv_color_t disp_buf1[1024 * 10]`
|
||||||
@ -211,7 +211,7 @@ void lv_disp_drv_init(lv_disp_drv_t * driver);
|
|||||||
* sent. Set to `NULL` if unused.
|
* sent. Set to `NULL` if unused.
|
||||||
* @param size_in_px_cnt size of the `buf1` and `buf2` in pixel count.
|
* @param size_in_px_cnt size of the `buf1` and `buf2` in pixel count.
|
||||||
*/
|
*/
|
||||||
void lv_disp_draw_buf_init(lv_disp_draw_buf_t * disp_buf, void * buf1, void * buf2, uint32_t size_in_px_cnt);
|
void lv_disp_draw_buf_init(lv_disp_draw_buf_t * draw_buf, void * buf1, void * buf2, uint32_t size_in_px_cnt);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register an initialized display driver.
|
* Register an initialized display driver.
|
||||||
|
@ -581,13 +581,13 @@ void lv_canvas_draw_rect(lv_obj_t * canvas, lv_coord_t x, lv_coord_t y, lv_coord
|
|||||||
lv_disp_t disp;
|
lv_disp_t disp;
|
||||||
lv_memset_00(&disp, sizeof(lv_disp_t));
|
lv_memset_00(&disp, sizeof(lv_disp_t));
|
||||||
|
|
||||||
lv_disp_draw_buf_t disp_buf;
|
lv_disp_draw_buf_t draw_buf;
|
||||||
lv_disp_draw_buf_init(&disp_buf, (void *)dsc->data, NULL, dsc->header.w * dsc->header.h);
|
lv_disp_draw_buf_init(&draw_buf, (void *)dsc->data, NULL, dsc->header.w * dsc->header.h);
|
||||||
lv_area_copy(&disp_buf.area, &mask);
|
lv_area_copy(&draw_buf.area, &mask);
|
||||||
|
|
||||||
lv_disp_drv_init(disp.driver);
|
lv_disp_drv_init(disp.driver);
|
||||||
|
|
||||||
disp.driver->draw_buf = &disp_buf;
|
disp.driver->draw_buf = &draw_buf;
|
||||||
disp.driver->hor_res = dsc->header.w;
|
disp.driver->hor_res = dsc->header.w;
|
||||||
disp.driver->ver_res = dsc->header.h;
|
disp.driver->ver_res = dsc->header.h;
|
||||||
|
|
||||||
@ -639,13 +639,13 @@ void lv_canvas_draw_text(lv_obj_t * canvas, lv_coord_t x, lv_coord_t y, lv_coord
|
|||||||
lv_disp_t disp;
|
lv_disp_t disp;
|
||||||
lv_memset_00(&disp, sizeof(lv_disp_t));
|
lv_memset_00(&disp, sizeof(lv_disp_t));
|
||||||
|
|
||||||
lv_disp_draw_buf_t disp_buf;
|
lv_disp_draw_buf_t draw_buf;
|
||||||
lv_disp_draw_buf_init(&disp_buf, (void *)dsc->data, NULL, dsc->header.w * dsc->header.h);
|
lv_disp_draw_buf_init(&draw_buf, (void *)dsc->data, NULL, dsc->header.w * dsc->header.h);
|
||||||
lv_area_copy(&disp_buf.area, &mask);
|
lv_area_copy(&draw_buf.area, &mask);
|
||||||
|
|
||||||
lv_disp_drv_init(disp.driver);
|
lv_disp_drv_init(disp.driver);
|
||||||
|
|
||||||
disp.driver->draw_buf = &disp_buf;
|
disp.driver->draw_buf = &draw_buf;
|
||||||
disp.driver->hor_res = dsc->header.w;
|
disp.driver->hor_res = dsc->header.w;
|
||||||
disp.driver->ver_res = dsc->header.h;
|
disp.driver->ver_res = dsc->header.h;
|
||||||
|
|
||||||
@ -697,13 +697,13 @@ void lv_canvas_draw_img(lv_obj_t * canvas, lv_coord_t x, lv_coord_t y, const voi
|
|||||||
lv_disp_t disp;
|
lv_disp_t disp;
|
||||||
lv_memset_00(&disp, sizeof(lv_disp_t));
|
lv_memset_00(&disp, sizeof(lv_disp_t));
|
||||||
|
|
||||||
lv_disp_draw_buf_t disp_buf;
|
lv_disp_draw_buf_t draw_buf;
|
||||||
lv_disp_draw_buf_init(&disp_buf, (void *)dsc->data, NULL, dsc->header.w * dsc->header.h);
|
lv_disp_draw_buf_init(&draw_buf, (void *)dsc->data, NULL, dsc->header.w * dsc->header.h);
|
||||||
lv_area_copy(&disp_buf.area, &mask);
|
lv_area_copy(&draw_buf.area, &mask);
|
||||||
|
|
||||||
lv_disp_drv_init(disp.driver);
|
lv_disp_drv_init(disp.driver);
|
||||||
|
|
||||||
disp.driver->draw_buf = &disp_buf;
|
disp.driver->draw_buf = &draw_buf;
|
||||||
disp.driver->hor_res = dsc->header.w;
|
disp.driver->hor_res = dsc->header.w;
|
||||||
disp.driver->ver_res = dsc->header.h;
|
disp.driver->ver_res = dsc->header.h;
|
||||||
|
|
||||||
@ -741,13 +741,13 @@ void lv_canvas_draw_line(lv_obj_t * canvas, const lv_point_t points[], uint32_t
|
|||||||
lv_disp_t disp;
|
lv_disp_t disp;
|
||||||
lv_memset_00(&disp, sizeof(lv_disp_t));
|
lv_memset_00(&disp, sizeof(lv_disp_t));
|
||||||
|
|
||||||
lv_disp_draw_buf_t disp_buf;
|
lv_disp_draw_buf_t draw_buf;
|
||||||
lv_disp_draw_buf_init(&disp_buf, (void *)dsc->data, NULL, dsc->header.w * dsc->header.h);
|
lv_disp_draw_buf_init(&draw_buf, (void *)dsc->data, NULL, dsc->header.w * dsc->header.h);
|
||||||
lv_area_copy(&disp_buf.area, &mask);
|
lv_area_copy(&draw_buf.area, &mask);
|
||||||
|
|
||||||
lv_disp_drv_init(disp.driver);
|
lv_disp_drv_init(disp.driver);
|
||||||
|
|
||||||
disp.driver->draw_buf = &disp_buf;
|
disp.driver->draw_buf = &draw_buf;
|
||||||
disp.driver->hor_res = dsc->header.w;
|
disp.driver->hor_res = dsc->header.w;
|
||||||
disp.driver->ver_res = dsc->header.h;
|
disp.driver->ver_res = dsc->header.h;
|
||||||
|
|
||||||
@ -796,13 +796,13 @@ void lv_canvas_draw_polygon(lv_obj_t * canvas, const lv_point_t points[], uint32
|
|||||||
lv_disp_t disp;
|
lv_disp_t disp;
|
||||||
lv_memset_00(&disp, sizeof(lv_disp_t));
|
lv_memset_00(&disp, sizeof(lv_disp_t));
|
||||||
|
|
||||||
lv_disp_draw_buf_t disp_buf;
|
lv_disp_draw_buf_t draw_buf;
|
||||||
lv_disp_draw_buf_init(&disp_buf, (void *)dsc->data, NULL, dsc->header.w * dsc->header.h);
|
lv_disp_draw_buf_init(&draw_buf, (void *)dsc->data, NULL, dsc->header.w * dsc->header.h);
|
||||||
lv_area_copy(&disp_buf.area, &mask);
|
lv_area_copy(&draw_buf.area, &mask);
|
||||||
|
|
||||||
lv_disp_drv_init(disp.driver);
|
lv_disp_drv_init(disp.driver);
|
||||||
|
|
||||||
disp.driver->draw_buf = &disp_buf;
|
disp.driver->draw_buf = &draw_buf;
|
||||||
disp.driver->hor_res = dsc->header.w;
|
disp.driver->hor_res = dsc->header.w;
|
||||||
disp.driver->ver_res = dsc->header.h;
|
disp.driver->ver_res = dsc->header.h;
|
||||||
|
|
||||||
@ -849,13 +849,13 @@ void lv_canvas_draw_arc(lv_obj_t * canvas, lv_coord_t x, lv_coord_t y, lv_coord_
|
|||||||
lv_disp_t disp;
|
lv_disp_t disp;
|
||||||
lv_memset_00(&disp, sizeof(lv_disp_t));
|
lv_memset_00(&disp, sizeof(lv_disp_t));
|
||||||
|
|
||||||
lv_disp_draw_buf_t disp_buf;
|
lv_disp_draw_buf_t draw_buf;
|
||||||
lv_disp_draw_buf_init(&disp_buf, (void *)dsc->data, NULL, dsc->header.w * dsc->header.h);
|
lv_disp_draw_buf_init(&draw_buf, (void *)dsc->data, NULL, dsc->header.w * dsc->header.h);
|
||||||
lv_area_copy(&disp_buf.area, &mask);
|
lv_area_copy(&draw_buf.area, &mask);
|
||||||
|
|
||||||
lv_disp_drv_init(disp.driver);
|
lv_disp_drv_init(disp.driver);
|
||||||
|
|
||||||
disp.driver->draw_buf = &disp_buf;
|
disp.driver->draw_buf = &draw_buf;
|
||||||
disp.driver->hor_res = dsc->header.w;
|
disp.driver->hor_res = dsc->header.w;
|
||||||
disp.driver->ver_res = dsc->header.h;
|
disp.driver->ver_res = dsc->header.h;
|
||||||
|
|
||||||
|
@ -91,14 +91,14 @@ static lv_fs_res_t tell_cb(struct _lv_fs_drv_t * drv, void * file_p, uint32_t *
|
|||||||
|
|
||||||
static void hal_init(void)
|
static void hal_init(void)
|
||||||
{
|
{
|
||||||
static lv_disp_draw_buf_t disp_buf;
|
static lv_disp_draw_buf_t draw_buf;
|
||||||
lv_color_t * disp_buf1 = (lv_color_t *)malloc(LV_HOR_RES * LV_VER_RES * sizeof(lv_color_t));
|
lv_color_t * disp_buf1 = (lv_color_t *)malloc(LV_HOR_RES * LV_VER_RES * sizeof(lv_color_t));
|
||||||
|
|
||||||
lv_disp_draw_buf_init(&disp_buf, disp_buf1, NULL, LV_HOR_RES * LV_VER_RES);
|
lv_disp_draw_buf_init(&draw_buf, disp_buf1, NULL, LV_HOR_RES * LV_VER_RES);
|
||||||
|
|
||||||
static lv_disp_drv_t disp_drv;
|
static lv_disp_drv_t disp_drv;
|
||||||
lv_disp_drv_init(&disp_drv);
|
lv_disp_drv_init(&disp_drv);
|
||||||
disp_drv.draw_buf = &disp_buf;
|
disp_drv.draw_buf = &draw_buf;
|
||||||
disp_drv.flush_cb = dummy_flush_cb;
|
disp_drv.flush_cb = dummy_flush_cb;
|
||||||
disp_drv.hor_res = HOR_RES;
|
disp_drv.hor_res = HOR_RES;
|
||||||
disp_drv.ver_res = VER_RES;
|
disp_drv.ver_res = VER_RES;
|
||||||
|
Loading…
Reference in New Issue
Block a user