fix(draw_map) use existing variables instead function calls
@@ -401,15 +401,15 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_map(const lv_area_t * map_area, const
const uint8_t * map_px;
+ lv_coord_t draw_area_h = lv_area_get_height(&draw_area);
+ lv_coord_t draw_area_w = lv_area_get_width(&draw_area);
+
lv_area_t blend_area;
blend_area.x1 = draw_area.x1 + disp_area->x1;
- blend_area.x2 = blend_area.x1 + lv_area_get_width(&draw_area) - 1;
+ blend_area.x2 = blend_area.x1 + draw_area_w - 1;
blend_area.y1 = disp_area->y1 + draw_area.y1;
blend_area.y2 = blend_area.y1;
- lv_coord_t draw_area_h = lv_area_get_height(&draw_area);
- lv_coord_t draw_area_w = lv_area_get_width(&draw_area);
-
bool transform = draw_dsc->angle != 0 || draw_dsc->zoom != LV_IMG_ZOOM_NONE ? true : false;
/*Simple ARGB image. Handle it as special case because it's very common*/
if(!mask_any && !transform && !chroma_key && draw_dsc->recolor_opa == LV_OPA_TRANSP && alpha_byte) {
@@ -451,7 +451,7 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_map(const lv_area_t * map_area, const
}
map_buf_tmp += map_w * px_size_byte;
- if(px_i + lv_area_get_width(&draw_area) < mask_buf_size) {
+ if(px_i + draw_area_w < mask_buf_size) {
blend_area.y2 ++;
}
else {
@@ -597,9 +597,9 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_map(const lv_area_t * map_area, const
lv_draw_mask_res_t mask_res_sub;
mask_res_sub = lv_draw_mask_apply(mask_buf + px_i_start, draw_area.x1 + draw_buf->area.x1,
y + draw_area.y1 + draw_buf->area.y1,
- lv_area_get_width(&draw_area));
+ draw_area_w);
if(mask_res_sub == LV_DRAW_MASK_RES_TRANSP) {
- lv_memset_00(mask_buf + px_i_start, lv_area_get_width(&draw_area));
+ lv_memset_00(mask_buf + px_i_start, draw_area_w);
mask_res = LV_DRAW_MASK_RES_CHANGED;
}
else if(mask_res_sub == LV_DRAW_MASK_RES_CHANGED) {
@@ -609,7 +609,7 @@ LV_ATTRIBUTE_FAST_MEM static void lv_draw_map(const lv_area_t * map_area, const
#endif
map_buf_tmp += map_w * px_size_byte;
- if(px_i + lv_area_get_width(&draw_area) < mask_buf_size) {
+ if(px_i + draw_area_w < mask_buf_size) {
blend_area.y2 ++;
}
else {
