From c31ab099f748ceba806c7584c8f922222578e3d3 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Thu, 9 May 2019 06:04:03 +0200 Subject: [PATCH] add MASK_AREA_DEBUG option --- src/lv_core/lv_refr.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/lv_core/lv_refr.c b/src/lv_core/lv_refr.c index 155b8c75f..7d2ee5659 100644 --- a/src/lv_core/lv_refr.c +++ b/src/lv_core/lv_refr.c @@ -14,6 +14,7 @@ #include "../lv_misc/lv_task.h" #include "../lv_misc/lv_mem.h" #include "../lv_misc/lv_gc.h" +#include "../lv_draw/lv_draw_basic.h" #if defined(LV_GC_INCLUDE) #include LV_GC_INCLUDE @@ -22,6 +23,8 @@ /********************* * DEFINES *********************/ +/* Draw translucent random colored areas on the invalidated (redrawn) areas*/ +#define MASK_AREA_DEBUG 0 /********************** * TYPEDEFS @@ -359,8 +362,7 @@ static void lv_refr_area_part(const lv_area_t * area_p) /*In non double buffered mode, before rendering the next part wait until the previous image is * flushed*/ if(lv_disp_is_double_buf(disp_refr) == false) { - while(vdb->flushing) - ; + while(vdb->flushing); } lv_obj_t * top_p; @@ -501,8 +503,13 @@ static void lv_refr_obj(lv_obj_t * obj, const lv_area_t * mask_ori_p) /* Redraw the object */ obj->design_cb(obj, &obj_ext_mask, LV_DESIGN_DRAW_MAIN); - // usleep(5 * 1000); /*DEBUG: Wait after every object draw to see the order of drawing*/ +#if MASK_AREA_DEBUG + static lv_color_t debug_color = LV_COLOR_RED; + lv_draw_fill(&obj_ext_mask, &obj_ext_mask, debug_color, LV_OPA_50); + debug_color.full *= 17; + debug_color.full += 0xA1; +#endif /*Create a new 'obj_mask' without 'ext_size' because the children can't be visible there*/ lv_obj_get_coords(obj, &obj_area); union_ok = lv_area_intersect(&obj_mask, mask_ori_p, &obj_area);