mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-28 07:03:00 +08:00
multi-disp: add unique inv_buf to each display
This commit is contained in:
parent
8c4e4c3861
commit
b15ffa3d89
@ -32,6 +32,26 @@
|
||||
* GLOBAL FUNCTIONS
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* Get the number of areas in the buffer
|
||||
* @return number of invalid areas
|
||||
*/
|
||||
uint16_t lv_disp_get_inv_buf_size(lv_disp_t * disp)
|
||||
{
|
||||
return disp->inv_p;
|
||||
}
|
||||
|
||||
/**
|
||||
* Pop (delete) the last 'num' invalidated areas from the buffer
|
||||
* @param num number of areas to delete
|
||||
*/
|
||||
void lv_disp_pop_from_inv_buf(lv_disp_t * disp, uint16_t num)
|
||||
{
|
||||
|
||||
if(disp->inv_p < num) disp->inv_p = 0;
|
||||
else disp->inv_p -= num;
|
||||
}
|
||||
|
||||
/**********************
|
||||
* STATIC FUNCTIONS
|
||||
**********************/
|
||||
|
@ -27,6 +27,18 @@ extern "C" {
|
||||
* GLOBAL PROTOTYPES
|
||||
**********************/
|
||||
|
||||
/**
|
||||
* Get the number of areas in the buffer
|
||||
* @return number of invalid areas
|
||||
*/
|
||||
uint16_t lv_disp_get_inv_buf_size(lv_disp_t * disp);
|
||||
|
||||
/**
|
||||
* Pop (delete) the last 'num' invalidated areas from the buffer
|
||||
* @param num number of areas to delete
|
||||
*/
|
||||
void lv_disp_pop_from_inv_buf(lv_disp_t * disp, uint16_t num);
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
@ -7,6 +7,8 @@
|
||||
* INCLUDES
|
||||
********************/
|
||||
#include "lv_indev.h"
|
||||
#include "lv_disp.h"
|
||||
#include "lv_obj.h"
|
||||
|
||||
#include "../lv_hal/lv_hal_tick.h"
|
||||
#include "../lv_core/lv_group.h"
|
||||
@ -14,7 +16,6 @@
|
||||
#include "../lv_misc/lv_task.h"
|
||||
#include "../lv_misc/lv_math.h"
|
||||
#include "../lv_draw/lv_draw_rbasic.h"
|
||||
#include "lv_obj.h"
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
@ -877,7 +878,7 @@ static void indev_drag(lv_indev_proc_t * state)
|
||||
/*Get the coordinates of the object and modify them*/
|
||||
lv_coord_t act_x = lv_obj_get_x(drag_obj);
|
||||
lv_coord_t act_y = lv_obj_get_y(drag_obj);
|
||||
uint16_t inv_buf_size = lv_refr_get_buf_size(); /*Get the number of currently invalidated areas*/
|
||||
uint16_t inv_buf_size = lv_disp_get_inv_buf_size(indev_act->driver.disp); /*Get the number of currently invalidated areas*/
|
||||
|
||||
lv_coord_t prev_x = drag_obj->coords.x1;
|
||||
lv_coord_t prev_y = drag_obj->coords.y1;
|
||||
@ -903,8 +904,8 @@ static void indev_drag(lv_indev_proc_t * state)
|
||||
lv_coord_t act_par_w = lv_obj_get_width(lv_obj_get_parent(drag_obj));
|
||||
lv_coord_t act_par_h = lv_obj_get_height(lv_obj_get_parent(drag_obj));
|
||||
if(act_par_w == prev_par_w && act_par_h == prev_par_h) {
|
||||
uint16_t new_inv_buf_size = lv_refr_get_buf_size();
|
||||
lv_refr_pop_from_buf(new_inv_buf_size - inv_buf_size);
|
||||
uint16_t new_inv_buf_size = lv_disp_get_inv_buf_size(indev_act->driver.disp);
|
||||
lv_disp_pop_from_inv_buf(indev_act->driver.disp, new_inv_buf_size - inv_buf_size);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -436,7 +436,7 @@ void lv_obj_invalidate(const lv_obj_t * obj)
|
||||
par = lv_obj_get_parent(par);
|
||||
}
|
||||
|
||||
if(union_ok != false) lv_inv_area(&area_trunc);
|
||||
if(union_ok) lv_inv_area(disp, &area_trunc);
|
||||
}
|
||||
}
|
||||
|
||||
@ -449,21 +449,6 @@ void lv_obj_invalidate(const lv_obj_t * obj)
|
||||
/*--------------
|
||||
* Screen set
|
||||
*--------------*/
|
||||
lv_disp_t * lv_scr_get_disp(lv_obj_t * scr)
|
||||
{
|
||||
lv_disp_t * d;
|
||||
|
||||
LL_READ(LV_GC_ROOT(_lv_disp_ll), d) {
|
||||
lv_obj_t * s;
|
||||
LL_READ(d->scr_ll, s) {
|
||||
if(s == scr) return d;
|
||||
}
|
||||
}
|
||||
|
||||
LV_LOG_WARN("lv_scr_get_disp: screen not found")
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load a new screen
|
||||
* @param scr pointer to a screen
|
||||
@ -1379,6 +1364,29 @@ lv_obj_t * lv_obj_get_screen(const lv_obj_t * obj)
|
||||
return (lv_obj_t *)act_p;
|
||||
}
|
||||
|
||||
lv_disp_t * lv_scr_get_disp(lv_obj_t * scr)
|
||||
{
|
||||
lv_disp_t * d;
|
||||
|
||||
LL_READ(LV_GC_ROOT(_lv_disp_ll), d) {
|
||||
lv_obj_t * s;
|
||||
LL_READ(d->scr_ll, s) {
|
||||
if(s == scr) return d;
|
||||
}
|
||||
}
|
||||
|
||||
LV_LOG_WARN("lv_scr_get_disp: screen not found")
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
lv_disp_t * lv_obj_get_disp(const lv_obj_t * obj)
|
||||
{
|
||||
lv_obj_t * scr = lv_obj_get_screen(obj);
|
||||
return lv_scr_get_disp(scr);
|
||||
}
|
||||
|
||||
/*---------------------
|
||||
* Parent/children get
|
||||
*--------------------*/
|
||||
|
@ -278,8 +278,6 @@ void lv_obj_invalidate(const lv_obj_t * obj);
|
||||
* Screen set
|
||||
*--------------*/
|
||||
|
||||
lv_disp_t * lv_scr_get_disp(lv_obj_t * scr);
|
||||
|
||||
/**
|
||||
* Load a new screen
|
||||
* @param scr pointer to a screen
|
||||
@ -584,6 +582,11 @@ lv_obj_t * lv_layer_sys(lv_disp_t * disp);
|
||||
*/
|
||||
lv_obj_t * lv_obj_get_screen(const lv_obj_t * obj);
|
||||
|
||||
|
||||
lv_disp_t * lv_scr_get_disp(lv_obj_t * scr);
|
||||
|
||||
lv_disp_t * lv_obj_get_disp(const lv_obj_t * obj);
|
||||
|
||||
/*---------------------
|
||||
* Parent/children get
|
||||
*--------------------*/
|
||||
|
@ -19,17 +19,10 @@
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
#ifndef LV_INV_FIFO_SIZE
|
||||
#define LV_INV_FIFO_SIZE 32 /*The average count of objects on a screen */
|
||||
#endif
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
typedef struct {
|
||||
lv_area_t area;
|
||||
uint8_t joined;
|
||||
} lv_join_t;
|
||||
|
||||
/**********************
|
||||
* STATIC PROTOTYPES
|
||||
@ -50,8 +43,6 @@ static void lv_refr_obj(lv_obj_t * obj, const lv_area_t * mask_ori_p);
|
||||
/**********************
|
||||
* STATIC VARIABLES
|
||||
**********************/
|
||||
static lv_join_t inv_buf[LV_INV_FIFO_SIZE];
|
||||
static uint16_t inv_buf_p;
|
||||
static void (*monitor_cb)(uint32_t, uint32_t); /*Monitor the rendering time*/
|
||||
static void (*round_cb)(lv_area_t *); /*If set then called to modify invalidated areas for special display controllers*/
|
||||
static uint32_t px_num;
|
||||
@ -70,9 +61,6 @@ static lv_disp_t * disp_refr; /*Display being refreshed*/
|
||||
*/
|
||||
void lv_refr_init(void)
|
||||
{
|
||||
inv_buf_p = 0;
|
||||
memset(inv_buf, 0, sizeof(inv_buf));
|
||||
|
||||
lv_task_t * task;
|
||||
task = lv_task_create(lv_refr_task, LV_REFR_PERIOD, LV_TASK_PRIO_MID, NULL);
|
||||
lv_task_ready(task); /*Be sure the screen will be refreshed immediately on start up*/
|
||||
@ -91,22 +79,26 @@ void lv_refr_now(void)
|
||||
|
||||
|
||||
/**
|
||||
* Invalidate an area
|
||||
* @param area_p pointer to area which should be invalidated
|
||||
* Invalidate an area on display to redraw it
|
||||
* @param area_p pointer to area which should be invalidated (NULL: delete the invalidated areas)
|
||||
* @param disp pointer to display where the area should be invalidated (NULL can be used if there is only one display)
|
||||
*/
|
||||
void lv_inv_area(const lv_area_t * area_p)
|
||||
void lv_inv_area(lv_disp_t * disp, const lv_area_t * area_p)
|
||||
{
|
||||
if(!disp) disp = lv_disp_get_last();
|
||||
if(!disp) return;
|
||||
|
||||
/*Clear the invalidate buffer if the parameter is NULL*/
|
||||
if(area_p == NULL) {
|
||||
inv_buf_p = 0;
|
||||
disp->inv_p = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
lv_area_t scr_area;
|
||||
scr_area.x1 = 0;
|
||||
scr_area.y1 = 0;
|
||||
scr_area.x2 = LV_HOR_RES_MAX - 1;
|
||||
scr_area.y2 = LV_VER_RES_MAX - 1;
|
||||
scr_area.x2 = disp->driver.hor_res - 1;
|
||||
scr_area.y2 = disp->driver.ver_res - 1;
|
||||
|
||||
lv_area_t com_area;
|
||||
bool suc;
|
||||
@ -119,18 +111,18 @@ void lv_inv_area(const lv_area_t * area_p)
|
||||
|
||||
/*Save only if this area is not in one of the saved areas*/
|
||||
uint16_t i;
|
||||
for(i = 0; i < inv_buf_p; i++) {
|
||||
if(lv_area_is_in(&com_area, &inv_buf[i].area) != false) return;
|
||||
for(i = 0; i < disp->inv_p; i++) {
|
||||
if(lv_area_is_in(&com_area, &disp->inv_areas[i]) != false) return;
|
||||
}
|
||||
|
||||
/*Save the area*/
|
||||
if(inv_buf_p < LV_INV_FIFO_SIZE) {
|
||||
lv_area_copy(&inv_buf[inv_buf_p].area, &com_area);
|
||||
if(disp->inv_p < LV_INV_BUF_SIZE) {
|
||||
lv_area_copy(&disp->inv_areas[disp->inv_p], &com_area);
|
||||
} else {/*If no place for the area add the screen*/
|
||||
inv_buf_p = 0;
|
||||
lv_area_copy(&inv_buf[inv_buf_p].area, &scr_area);
|
||||
disp->inv_p = 0;
|
||||
lv_area_copy(&disp->inv_areas[disp->inv_p], &scr_area);
|
||||
}
|
||||
inv_buf_p ++;
|
||||
disp->inv_p ++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -156,25 +148,6 @@ void lv_refr_set_round_cb(void(*cb)(lv_area_t *))
|
||||
round_cb = cb;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the number of areas in the buffer
|
||||
* @return number of invalid areas
|
||||
*/
|
||||
uint16_t lv_refr_get_buf_size(void)
|
||||
{
|
||||
return inv_buf_p;
|
||||
}
|
||||
|
||||
/**
|
||||
* Pop (delete) the last 'num' invalidated areas from the buffer
|
||||
* @param num number of areas to delete
|
||||
*/
|
||||
void lv_refr_pop_from_buf(uint16_t num)
|
||||
{
|
||||
if(inv_buf_p < num) inv_buf_p = 0;
|
||||
else inv_buf_p -= num;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the display which is being refreshed
|
||||
* @return the display being refreshed
|
||||
@ -208,7 +181,7 @@ static void lv_refr_task(void * param)
|
||||
lv_refr_areas();
|
||||
|
||||
/*If refresh happened ...*/
|
||||
if(inv_buf_p != 0) {
|
||||
if(disp_refr->inv_p != 0) {
|
||||
|
||||
/*In true double buffered mode copy the refreshed areas to the new VDB to keep it up to date*/
|
||||
#if LV_VDB_TRUE_DOUBLE_BUFFERED
|
||||
@ -247,8 +220,9 @@ static void lv_refr_task(void * param)
|
||||
#endif
|
||||
|
||||
/*Clean up*/
|
||||
memset(inv_buf, 0, sizeof(inv_buf));
|
||||
inv_buf_p = 0;
|
||||
memset(disp_refr->inv_areas, 0, sizeof(disp_refr->inv_areas));
|
||||
memset(disp_refr->inv_area_joined, 0, sizeof(disp_refr->inv_area_joined));
|
||||
disp_refr->inv_p = 0;
|
||||
|
||||
/*Call monitor cb if present*/
|
||||
if(monitor_cb != NULL) {
|
||||
@ -269,32 +243,32 @@ static void lv_refr_join_area(void)
|
||||
uint32_t join_from;
|
||||
uint32_t join_in;
|
||||
lv_area_t joined_area;
|
||||
for(join_in = 0; join_in < inv_buf_p; join_in++) {
|
||||
if(inv_buf[join_in].joined != 0) continue;
|
||||
for(join_in = 0; join_in < disp_refr->inv_p; join_in++) {
|
||||
if(disp_refr->inv_area_joined[join_in] != 0) continue;
|
||||
|
||||
/*Check all areas to join them in 'join_in'*/
|
||||
for(join_from = 0; join_from < inv_buf_p; join_from++) {
|
||||
for(join_from = 0; join_from < disp_refr->inv_p; join_from++) {
|
||||
/*Handle only unjoined areas and ignore itself*/
|
||||
if(inv_buf[join_from].joined != 0 || join_in == join_from) {
|
||||
if(disp_refr->inv_area_joined[join_from] != 0 || join_in == join_from) {
|
||||
continue;
|
||||
}
|
||||
|
||||
/*Check if the areas are on each other*/
|
||||
if(lv_area_is_on(&inv_buf[join_in].area,
|
||||
&inv_buf[join_from].area) == false) {
|
||||
if(lv_area_is_on(&disp_refr->inv_areas[join_in],
|
||||
&disp_refr->inv_areas[join_from]) == false) {
|
||||
continue;
|
||||
}
|
||||
|
||||
lv_area_join(&joined_area, &inv_buf[join_in].area,
|
||||
&inv_buf[join_from].area);
|
||||
lv_area_join(&joined_area, &disp_refr->inv_areas[join_in],
|
||||
&disp_refr->inv_areas[join_from]);
|
||||
|
||||
/*Join two area only if the joined area size is smaller*/
|
||||
if(lv_area_get_size(&joined_area) <
|
||||
(lv_area_get_size(&inv_buf[join_in].area) + lv_area_get_size(&inv_buf[join_from].area))) {
|
||||
lv_area_copy(&inv_buf[join_in].area, &joined_area);
|
||||
(lv_area_get_size(&disp_refr->inv_areas[join_in]) + lv_area_get_size(&disp_refr->inv_areas[join_from]))) {
|
||||
lv_area_copy(&disp_refr->inv_areas[join_in], &joined_area);
|
||||
|
||||
/*Mark 'join_form' is joined into 'join_in'*/
|
||||
inv_buf[join_from].joined = 1;
|
||||
disp_refr->inv_area_joined[join_from] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -308,17 +282,17 @@ static void lv_refr_areas(void)
|
||||
px_num = 0;
|
||||
uint32_t i;
|
||||
|
||||
for(i = 0; i < inv_buf_p; i++) {
|
||||
for(i = 0; i < disp_refr->inv_p; i++) {
|
||||
/*Refresh the unjoined areas*/
|
||||
if(inv_buf[i].joined == 0) {
|
||||
if(disp_refr->inv_area_joined[i] == 0) {
|
||||
/*If there is no VDB do simple drawing*/
|
||||
#if LV_VDB_SIZE == 0
|
||||
lv_refr_area_no_vdb(&inv_buf[i].area);
|
||||
#else
|
||||
/*If VDB is used...*/
|
||||
lv_refr_area_with_vdb(&inv_buf[i].area);
|
||||
lv_refr_area_with_vdb(&disp_refr->inv_areas[i]);
|
||||
#endif
|
||||
if(monitor_cb != NULL) px_num += lv_area_get_size(&inv_buf[i].area);
|
||||
if(monitor_cb != NULL) px_num += lv_area_get_size(&disp_refr->inv_areas[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -54,10 +54,11 @@ void lv_refr_init(void);
|
||||
void lv_refr_now(void);
|
||||
|
||||
/**
|
||||
* Invalidate an area
|
||||
* @param area_p pointer to area which should be invalidated
|
||||
* Invalidate an area on display to redraw it
|
||||
* @param area_p pointer to area which should be invalidated (NULL: delete the invalidated areas)
|
||||
* @param disp pointer to display where the area should be invalidated (NULL can be used if there is only one display)
|
||||
*/
|
||||
void lv_inv_area(const lv_area_t * area_p);
|
||||
void lv_inv_area(lv_disp_t * disp, const lv_area_t * area_p);
|
||||
|
||||
/**
|
||||
* Set a function to call after every refresh to announce the refresh time and the number of refreshed pixels
|
||||
|
@ -94,6 +94,8 @@ lv_disp_t * lv_disp_drv_register(lv_disp_drv_t * driver)
|
||||
lv_obj_set_style(node->top_layer, &lv_style_transp);
|
||||
lv_obj_set_style(node->sys_layer, &lv_style_transp);
|
||||
|
||||
node->inv_p = 0;
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
|
@ -25,6 +25,9 @@ extern "C" {
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
#ifndef LV_INV_BUF_SIZE
|
||||
#define LV_INV_BUF_SIZE 32 /*Buffer size for invalid areas */
|
||||
#endif
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
@ -66,7 +69,9 @@ struct _lv_obj_t;
|
||||
|
||||
typedef struct _disp_t {
|
||||
lv_disp_drv_t driver;
|
||||
lv_area_t inv_buf[32];
|
||||
lv_area_t inv_areas[LV_INV_BUF_SIZE];
|
||||
uint8_t inv_area_joined[LV_INV_BUF_SIZE];
|
||||
uint16_t inv_p;
|
||||
lv_ll_t scr_ll;
|
||||
struct _lv_obj_t * act_scr;
|
||||
struct _lv_obj_t * top_layer;
|
||||
|
@ -561,6 +561,7 @@ static lv_res_t lv_btnm_signal(lv_obj_t * btnm, lv_signal_t sign, void * param)
|
||||
/*Invalidate to old and the new areas*/;
|
||||
lv_obj_get_coords(btnm, &btnm_area);
|
||||
if(btn_pr != ext->btn_id_pr) {
|
||||
lv_disp_t * disp = lv_obj_get_disp(btnm);
|
||||
lv_indev_reset_lpr(param);
|
||||
if(ext->btn_id_pr != LV_BTNM_PR_NONE) {
|
||||
lv_area_copy(&btn_area, &ext->button_areas[ext->btn_id_pr]);
|
||||
@ -568,7 +569,7 @@ static lv_res_t lv_btnm_signal(lv_obj_t * btnm, lv_signal_t sign, void * param)
|
||||
btn_area.y1 += btnm_area.y1;
|
||||
btn_area.x2 += btnm_area.x1;
|
||||
btn_area.y2 += btnm_area.y1;
|
||||
lv_inv_area(&btn_area);
|
||||
lv_inv_area(disp, &btn_area);
|
||||
}
|
||||
if(btn_pr != LV_BTNM_PR_NONE) {
|
||||
lv_area_copy(&btn_area, &ext->button_areas[btn_pr]);
|
||||
@ -576,7 +577,7 @@ static lv_res_t lv_btnm_signal(lv_obj_t * btnm, lv_signal_t sign, void * param)
|
||||
btn_area.y1 += btnm_area.y1;
|
||||
btn_area.x2 += btnm_area.x1;
|
||||
btn_area.y2 += btnm_area.y1;
|
||||
lv_inv_area(&btn_area);
|
||||
lv_inv_area(disp, &btn_area);
|
||||
}
|
||||
}
|
||||
|
||||
@ -599,6 +600,7 @@ static lv_res_t lv_btnm_signal(lv_obj_t * btnm, lv_signal_t sign, void * param)
|
||||
if(button_is_inactive(ext->map_p[txt_i]) == false && txt_i != LV_BTNM_PR_NONE) { /*Ignore the inactive buttons anf click between the buttons*/
|
||||
if(ext->action) res = ext->action(btnm, cut_ctrl_byte(ext->map_p[txt_i]));
|
||||
if(res == LV_RES_OK) {
|
||||
lv_disp_t * disp = lv_obj_get_disp(btnm);
|
||||
|
||||
/*Invalidate to old pressed area*/;
|
||||
lv_obj_get_coords(btnm, &btnm_area);
|
||||
@ -607,7 +609,7 @@ static lv_res_t lv_btnm_signal(lv_obj_t * btnm, lv_signal_t sign, void * param)
|
||||
btn_area.y1 += btnm_area.y1;
|
||||
btn_area.x2 += btnm_area.x1;
|
||||
btn_area.y2 += btnm_area.y1;
|
||||
lv_inv_area(&btn_area);
|
||||
lv_inv_area(disp, &btn_area);
|
||||
|
||||
if(ext->toggle != 0) {
|
||||
/*Invalidate to old toggled area*/;
|
||||
@ -616,7 +618,7 @@ static lv_res_t lv_btnm_signal(lv_obj_t * btnm, lv_signal_t sign, void * param)
|
||||
btn_area.y1 += btnm_area.y1;
|
||||
btn_area.x2 += btnm_area.x1;
|
||||
btn_area.y2 += btnm_area.y1;
|
||||
lv_inv_area(&btn_area);
|
||||
lv_inv_area(disp, &btn_area);
|
||||
ext->btn_id_tgl = ext->btn_id_pr;
|
||||
|
||||
}
|
||||
|
@ -1000,6 +1000,7 @@ static lv_res_t lv_page_scrollable_signal(lv_obj_t * scrl, lv_signal_t sign, voi
|
||||
|
||||
/*Hide scrollbars if required*/
|
||||
if(page_ext->sb.mode == LV_SB_MODE_DRAG) {
|
||||
lv_disp_t * disp = lv_obj_get_disp(page);
|
||||
lv_area_t sb_area_tmp;
|
||||
if(page_ext->sb.hor_draw) {
|
||||
lv_area_copy(&sb_area_tmp, &page_ext->sb.hor_area);
|
||||
@ -1007,7 +1008,7 @@ static lv_res_t lv_page_scrollable_signal(lv_obj_t * scrl, lv_signal_t sign, voi
|
||||
sb_area_tmp.y1 += page->coords.y1;
|
||||
sb_area_tmp.x2 += page->coords.x1;
|
||||
sb_area_tmp.y2 += page->coords.y1;
|
||||
lv_inv_area(&sb_area_tmp);
|
||||
lv_inv_area(disp, &sb_area_tmp);
|
||||
page_ext->sb.hor_draw = 0;
|
||||
}
|
||||
if(page_ext->sb.ver_draw) {
|
||||
@ -1016,7 +1017,7 @@ static lv_res_t lv_page_scrollable_signal(lv_obj_t * scrl, lv_signal_t sign, voi
|
||||
sb_area_tmp.y1 += page->coords.y1;
|
||||
sb_area_tmp.x2 += page->coords.x1;
|
||||
sb_area_tmp.y2 += page->coords.y1;
|
||||
lv_inv_area(&sb_area_tmp);
|
||||
lv_inv_area(disp, &sb_area_tmp);
|
||||
page_ext->sb.ver_draw = 0;
|
||||
}
|
||||
}
|
||||
@ -1068,6 +1069,7 @@ static void lv_page_sb_refresh(lv_obj_t * page)
|
||||
}
|
||||
|
||||
/*Invalidate the current (old) scrollbar areas*/
|
||||
lv_disp_t * disp = lv_obj_get_disp(page);
|
||||
lv_area_t sb_area_tmp;
|
||||
if(ext->sb.hor_draw != 0) {
|
||||
lv_area_copy(&sb_area_tmp, &ext->sb.hor_area);
|
||||
@ -1075,7 +1077,7 @@ static void lv_page_sb_refresh(lv_obj_t * page)
|
||||
sb_area_tmp.y1 += page->coords.y1;
|
||||
sb_area_tmp.x2 += page->coords.x1;
|
||||
sb_area_tmp.y2 += page->coords.y1;
|
||||
lv_inv_area(&sb_area_tmp);
|
||||
lv_inv_area(disp, &sb_area_tmp);
|
||||
}
|
||||
if(ext->sb.ver_draw != 0) {
|
||||
lv_area_copy(&sb_area_tmp, &ext->sb.ver_area);
|
||||
@ -1083,7 +1085,7 @@ static void lv_page_sb_refresh(lv_obj_t * page)
|
||||
sb_area_tmp.y1 += page->coords.y1;
|
||||
sb_area_tmp.x2 += page->coords.x1;
|
||||
sb_area_tmp.y2 += page->coords.y1;
|
||||
lv_inv_area(&sb_area_tmp);
|
||||
lv_inv_area(disp, &sb_area_tmp);
|
||||
}
|
||||
|
||||
|
||||
@ -1137,7 +1139,7 @@ static void lv_page_sb_refresh(lv_obj_t * page)
|
||||
sb_area_tmp.y1 += page->coords.y1;
|
||||
sb_area_tmp.x2 += page->coords.x1;
|
||||
sb_area_tmp.y2 += page->coords.y1;
|
||||
lv_inv_area(&sb_area_tmp);
|
||||
lv_inv_area(disp, &sb_area_tmp);
|
||||
}
|
||||
if(ext->sb.ver_draw != 0) {
|
||||
lv_area_copy(&sb_area_tmp, &ext->sb.ver_area);
|
||||
@ -1145,7 +1147,7 @@ static void lv_page_sb_refresh(lv_obj_t * page)
|
||||
sb_area_tmp.y1 += page->coords.y1;
|
||||
sb_area_tmp.x2 += page->coords.x1;
|
||||
sb_area_tmp.y2 += page->coords.y1;
|
||||
lv_inv_area(&sb_area_tmp);
|
||||
lv_inv_area(disp, &sb_area_tmp);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1136,13 +1136,14 @@ static void cursor_blink_anim(lv_obj_t * ta, uint8_t show)
|
||||
if(ext->cursor.type != LV_CURSOR_NONE &&
|
||||
(ext->cursor.type & LV_CURSOR_HIDDEN) == 0)
|
||||
{
|
||||
lv_disp_t * disp = lv_obj_get_disp(ta);
|
||||
lv_area_t area_tmp;
|
||||
lv_area_copy(&area_tmp, &ext->cursor.area);
|
||||
area_tmp.x1 += ext->label->coords.x1;
|
||||
area_tmp.y1 += ext->label->coords.y1;
|
||||
area_tmp.x2 += ext->label->coords.x1;
|
||||
area_tmp.y2 += ext->label->coords.y1;
|
||||
lv_inv_area(&area_tmp);
|
||||
lv_inv_area(disp, &area_tmp);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1327,13 +1328,14 @@ static void refr_cursor_area(lv_obj_t * ta)
|
||||
}
|
||||
|
||||
/*Save the new area*/
|
||||
lv_disp_t * disp = lv_obj_get_disp(ta);
|
||||
lv_area_t area_tmp;
|
||||
lv_area_copy(&area_tmp, &ext->cursor.area);
|
||||
area_tmp.x1 += ext->label->coords.x1;
|
||||
area_tmp.y1 += ext->label->coords.y1;
|
||||
area_tmp.x2 += ext->label->coords.x1;
|
||||
area_tmp.y2 += ext->label->coords.y1;
|
||||
lv_inv_area(&area_tmp);
|
||||
lv_inv_area(disp, &area_tmp);
|
||||
|
||||
lv_area_copy(&ext->cursor.area, &cur_area);
|
||||
|
||||
@ -1342,7 +1344,7 @@ static void refr_cursor_area(lv_obj_t * ta)
|
||||
area_tmp.y1 += ext->label->coords.y1;
|
||||
area_tmp.x2 += ext->label->coords.x1;
|
||||
area_tmp.y2 += ext->label->coords.y1;
|
||||
lv_inv_area(&area_tmp);
|
||||
lv_inv_area(disp, &area_tmp);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -106,7 +106,8 @@ lv_obj_t * lv_tabview_create(lv_obj_t * par, const lv_obj_t * copy)
|
||||
ext->tab_name_ptr[0] = "";
|
||||
ext->tab_cnt = 0;
|
||||
|
||||
lv_obj_set_size(new_tabview, LV_DPI * 3, LV_DPI * 2);
|
||||
lv_disp_t * disp = lv_obj_get_disp(par);
|
||||
lv_obj_set_size(new_tabview, lv_disp_get_hor_res(disp), lv_disp_get_ver_res(disp));
|
||||
|
||||
ext->btns = lv_btnm_create(new_tabview, NULL);
|
||||
lv_obj_set_height(ext->btns, 3 * LV_DPI / 4);
|
||||
|
Loading…
x
Reference in New Issue
Block a user