1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-14 06:42:58 +08:00

lv_img_buf_transorm: remove unnecessary calculations

This commit is contained in:
Gabor Kiss-Vamosi 2020-03-26 15:50:24 +01:00
parent f6ad61c88b
commit 21a7acd7a2

View File

@ -538,7 +538,6 @@ bool lv_img_buf_transform(lv_img_transform_dsc_t * dsc, lv_coord_t x, lv_coord_t
dsc->tmp.px_size = px_size;
bool ret;
ret = transform_anti_alias(dsc);
return ret;
@ -716,18 +715,15 @@ static inline bool transform_anti_alias(lv_img_transform_dsc_t * dsc)
lv_color_t c0;
if(xr0 == LV_OPA_TRANSP) c0 = c01;
else if(xr0 == LV_OPA_COVER) c0 = c00;
else if(c00.full == c01.full) c0 = c00;
else c0 = lv_color_mix(c00, c01, xr0);
lv_color_t c1;
if(xr1 == LV_OPA_TRANSP) c1 = c11;
else if(xr1 == LV_OPA_COVER) c1 = c10;
else if(c10.full == c11.full) c1 = c00;
else c1 = lv_color_mix(c10, c11, xr1);
if(yr == LV_OPA_TRANSP) dsc->res.color = c1;
else if(yr == LV_OPA_COVER) dsc->res.color = c0;
else if(c0.full == c1.full) dsc->res.color = c0;
else dsc->res.color = lv_color_mix(c0, c1, yr);
return true;