mirror of
https://github.com/lvgl/lvgl.git
synced 2026-06-01 00:51:49 +08:00
fix(debug): fix LV_USE_PARALLEL_DRAW_DEBUG
This commit is contained in:
@@ -13,6 +13,7 @@
|
|||||||
#include "lv_draw_sw.h"
|
#include "lv_draw_sw.h"
|
||||||
#include "../../display/lv_display_private.h"
|
#include "../../display/lv_display_private.h"
|
||||||
#include "../../stdlib/lv_string.h"
|
#include "../../stdlib/lv_string.h"
|
||||||
|
#include "../../core/lv_global.h"
|
||||||
|
|
||||||
/*********************
|
/*********************
|
||||||
* DEFINES
|
* DEFINES
|
||||||
@@ -34,13 +35,10 @@ static void execute_drawing(lv_draw_sw_unit_t * u);
|
|||||||
|
|
||||||
static int32_t lv_draw_sw_dispatch(lv_draw_unit_t * draw_unit, lv_layer_t * layer);
|
static int32_t lv_draw_sw_dispatch(lv_draw_unit_t * draw_unit, lv_layer_t * layer);
|
||||||
|
|
||||||
/**********************
|
|
||||||
* GLOBAL PROTOTYPES
|
|
||||||
**********************/
|
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
* STATIC VARIABLES
|
* STATIC VARIABLES
|
||||||
**********************/
|
**********************/
|
||||||
|
#define _draw_info LV_GLOBAL_DEFAULT()->draw_info
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
* MACROS
|
* MACROS
|
||||||
@@ -182,8 +180,7 @@ static void execute_drawing(lv_draw_sw_unit_t * u)
|
|||||||
if(!_lv_area_intersect(&draw_area, &t->area, u->base_unit.clip_area)) return;
|
if(!_lv_area_intersect(&draw_area, &t->area, u->base_unit.clip_area)) return;
|
||||||
|
|
||||||
int32_t idx = 0;
|
int32_t idx = 0;
|
||||||
lv_display_t * disp = _lv_refr_get_disp_refreshing();
|
lv_draw_unit_t * draw_unit_tmp = _draw_info.unit_head;
|
||||||
lv_draw_unit_t * draw_unit_tmp = disp->draw_unit_head;
|
|
||||||
while(draw_unit_tmp != (lv_draw_unit_t *)u) {
|
while(draw_unit_tmp != (lv_draw_unit_t *)u) {
|
||||||
draw_unit_tmp = draw_unit_tmp->next;
|
draw_unit_tmp = draw_unit_tmp->next;
|
||||||
idx++;
|
idx++;
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
#include "../../misc/lv_math.h"
|
#include "../../misc/lv_math.h"
|
||||||
#include "../../misc/lv_color.h"
|
#include "../../misc/lv_color.h"
|
||||||
#include "../../stdlib/lv_string.h"
|
#include "../../stdlib/lv_string.h"
|
||||||
|
#include "../../core/lv_global.h"
|
||||||
|
|
||||||
/*********************
|
/*********************
|
||||||
* DEFINES
|
* DEFINES
|
||||||
@@ -37,6 +38,7 @@ static void img_draw_core(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t
|
|||||||
/**********************
|
/**********************
|
||||||
* STATIC VARIABLES
|
* STATIC VARIABLES
|
||||||
**********************/
|
**********************/
|
||||||
|
#define _draw_info LV_GLOBAL_DEFAULT()->draw_info
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
* MACROS
|
* MACROS
|
||||||
@@ -105,21 +107,24 @@ void lv_draw_sw_layer(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t * dr
|
|||||||
|
|
||||||
#if LV_USE_PARALLEL_DRAW_DEBUG
|
#if LV_USE_PARALLEL_DRAW_DEBUG
|
||||||
uint32_t idx = 0;
|
uint32_t idx = 0;
|
||||||
lv_display_t * disp = _lv_refr_get_disp_refreshing();
|
lv_draw_unit_t * draw_unit_tmp = _draw_info.unit_head;
|
||||||
lv_draw_unit_t * draw_unit_tmp = disp->draw_unit_head;
|
|
||||||
while(draw_unit_tmp != draw_unit) {
|
while(draw_unit_tmp != draw_unit) {
|
||||||
draw_unit_tmp = draw_unit_tmp->next;
|
draw_unit_tmp = draw_unit_tmp->next;
|
||||||
idx++;
|
idx++;
|
||||||
}
|
}
|
||||||
|
|
||||||
lv_draw_rect_dsc_t rect_dsc;
|
lv_draw_fill_dsc_t fill_dsc;
|
||||||
lv_draw_rect_dsc_init(&rect_dsc);
|
lv_draw_rect_dsc_init(&fill_dsc);
|
||||||
rect_dsc.bg_color = lv_palette_main(idx % _LV_PALETTE_LAST);
|
fill_dsc.color = lv_palette_main(idx % _LV_PALETTE_LAST);
|
||||||
rect_dsc.border_color = rect_dsc.bg_color;
|
fill_dsc.opa = LV_OPA_10;
|
||||||
rect_dsc.bg_opa = LV_OPA_10;
|
lv_draw_sw_fill(draw_unit, &fill_dsc, &area_rot);
|
||||||
rect_dsc.border_opa = LV_OPA_100;
|
|
||||||
rect_dsc.border_width = 2;
|
lv_draw_border_dsc_t border_dsc;
|
||||||
lv_draw_sw_rect(draw_unit, &rect_dsc, &area_rot);
|
lv_draw_border_dsc_init(&border_dsc);
|
||||||
|
border_dsc.color = lv_palette_main(idx % _LV_PALETTE_LAST);
|
||||||
|
border_dsc.opa = LV_OPA_100;
|
||||||
|
border_dsc.width = 2;
|
||||||
|
lv_draw_sw_border(draw_unit, &border_dsc, &area_rot);
|
||||||
|
|
||||||
lv_point_t txt_size;
|
lv_point_t txt_size;
|
||||||
lv_text_get_size(&txt_size, "W", LV_FONT_DEFAULT, 0, 0, 100, LV_TEXT_FLAG_NONE);
|
lv_text_get_size(&txt_size, "W", LV_FONT_DEFAULT, 0, 0, 100, LV_TEXT_FLAG_NONE);
|
||||||
@@ -130,9 +135,9 @@ void lv_draw_sw_layer(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t * dr
|
|||||||
txt_area.y2 = draw_area.y2;
|
txt_area.y2 = draw_area.y2;
|
||||||
txt_area.y1 = draw_area.y2 - txt_size.y + 1;
|
txt_area.y1 = draw_area.y2 - txt_size.y + 1;
|
||||||
|
|
||||||
lv_draw_rect_dsc_init(&rect_dsc);
|
lv_draw_fill_dsc_init(&fill_dsc);
|
||||||
rect_dsc.bg_color = lv_color_black();
|
fill_dsc.color = lv_color_black();
|
||||||
lv_draw_sw_rect(draw_unit, &rect_dsc, &txt_area);
|
lv_draw_sw_fill(draw_unit, &fill_dsc, &txt_area);
|
||||||
|
|
||||||
char buf[8];
|
char buf[8];
|
||||||
lv_snprintf(buf, sizeof(buf), "%d", idx);
|
lv_snprintf(buf, sizeof(buf), "%d", idx);
|
||||||
|
|||||||
Reference in New Issue
Block a user