antialias: LV_ANTIALAS added, x4 atialas removed, LV_UPSCALE_MAP removed

This commit is contained in:
Gabor
2017-01-06 16:00:37 +01:00
parent 1e57771405
commit e5dad65949
7 changed files with 23 additions and 142 deletions

View File

@@ -155,7 +155,7 @@ static void dispi_task(void * param)
*/
static void dispi_proc_point(lv_dispi_t * dispi_p, cord_t x, cord_t y)
{
#if LV_DOWNSCALE > 1 && LV_VDB_SIZE != 0
#if LV_ANTIALIAS != 0 && LV_VDB_SIZE != 0
dispi_p->act_point.x = x * LV_DOWNSCALE;
dispi_p->act_point.y = y * LV_DOWNSCALE;
#else

View File

@@ -24,11 +24,11 @@
#error "LV: LV_HOR_RES and LV_VER_RES must be greater then 0"
#endif
#if LV_DOWNSCALE != 1 && LV_DOWNSCALE != 2 && LV_DOWNSCALE != 4
#error "LV: LV_DOWNSCALE can be only 1, 2 or 4"
#if LV_DOWNSCALE != 1 && LV_DOWNSCALE != 2
#error "LV: LV_DOWNSCALE can be only 1 or 2"
#endif
#if LV_VDB_SIZE == 0 && (LV_DOWNSCALE != 1 || LV_UPSCALE_MAP != 0 || LV_UPSCALE_STYLE != 0)
#if LV_VDB_SIZE == 0 && LV_DOWNSCALE != 1
#error "LV: If LV_VDB_SIZE == 0 then LV_DOWNSCALE must be 1, LV_UPSCALE_MAP 0, LV_UPSCALE_STYLE 0"
#endif

View File

@@ -96,11 +96,6 @@ void lv_inv_area(const area_t * area_p)
com_area.y1 = com_area.y1 & (~0x1);
com_area.x2 = com_area.x2 | 0x1;
com_area.y2 = com_area.y2 | 0x1;
#elif LV_DOWNSCALE == 4
com_area.x1 = com_area.x1 & (~0x3);
com_area.y1 = com_area.y1 & (~0x3);
com_area.x2 = com_area.x2 | 0x3;
com_area.y2 = com_area.y2 | 0x3;
#endif
/*Save only if this area is not in one of the saved areas*/
@@ -240,8 +235,6 @@ static void lv_refr_area_with_vdb(const area_t * area_p)
/*Round the row number with downscale*/
#if LV_DOWNSCALE == 2
max_row &= (~0x1);
#elif LV_DOWNSCALE == 4
max_row &= (~0x3);
#endif
/*Refresh all rows*/

View File

@@ -52,11 +52,10 @@ lv_vdb_t * lv_vdb_get(void)
*/
void lv_vdb_flush(void)
{
#if LV_DOWNSCALE < 2
#if LV_ANTIALIAS == 0
disp_area(DISP_ID_ALL, vdb.vdb_area.x1 , vdb.vdb_area.y1, vdb.vdb_area.x2, vdb.vdb_area.y2);
disp_map(DISP_ID_ALL, vdb.buf);
#elif LV_DOWNSCALE == 2
#else
color_t row_buf[LV_HOR_RES / LV_DOWNSCALE];
color_t * row_buf_p;
cord_t x;
@@ -88,55 +87,7 @@ void lv_vdb_flush(void)
disp_area(DISP_ID_ALL, vdb.vdb_area.x1 >> 1, y, vdb.vdb_area.x2 >> 1, y);
disp_map(DISP_ID_ALL, row_buf);
}
#elif LV_DOWNSCALE == 4
color_t row_buf[LV_HOR_RES / LV_DOWNSCALE];
color_t * row_buf_p;
cord_t x;
cord_t y;
cord_t w = area_get_width(&vdb.vdb_area);
cord_t i;
color_t * buf_p = vdb.buf;
for(y = vdb.vdb_area.y1 >> 2; y <= vdb.vdb_area.y2 >> 2; y ++) {
i = 0;
row_buf_p = row_buf;
for(x = vdb.vdb_area.x1; x < vdb.vdb_area.x2; x += 4, i += 4) {
row_buf_p->red = (buf_p[i].red + buf_p[i + 1].red +
buf_p[i + 2].red + buf_p[i + 3].red +
buf_p[i + w].red + buf_p[i + w + 1].red +
buf_p[i + w + 2].red + buf_p[i + w + 3].red +
buf_p[i + 2 * w].red + buf_p[i + 2 * w + 1].red +
buf_p[i + 2 * w + 2].red + buf_p[i + 2 * w + 3].red +
buf_p[i + 3 * w].red + buf_p[i + 3 * w + 1].red +
buf_p[i + 3 * w + 2].red + buf_p[i + 3 * w + 3].red) >>4 ;
row_buf_p->green = (buf_p[i].green + buf_p[i + 1].green +
buf_p[i + 2].green + buf_p[i + 3].green +
buf_p[i + w].green + buf_p[i + w + 1].green +
buf_p[i + w + 2].green + buf_p[i + w + 3].green +
buf_p[i + 2 * w].green + buf_p[i + 2 * w + 1].green +
buf_p[i + 2 * w + 2].green + buf_p[i + 2 * w + 3].green +
buf_p[i + 3 * w].green + buf_p[i + 3 * w + 1].green +
buf_p[i + 3 * w + 2].green + buf_p[i + 3 * w + 3].green) >>4 ;
row_buf_p->blue = (buf_p[i].blue + buf_p[i + 1].blue +
buf_p[i + 2].blue + buf_p[i + 3].blue +
buf_p[i + w].blue + buf_p[i + w + 1].blue +
buf_p[i + w + 2].blue + buf_p[i + w + 3].blue +
buf_p[i + 2 * w].blue + buf_p[i + 2 * w + 1].blue +
buf_p[i + 2 * w + 2].blue + buf_p[i + 2 * w + 3].blue +
buf_p[i + 3 * w].blue + buf_p[i + 3 * w + 1].blue +
buf_p[i + 3 * w + 2].blue + buf_p[i + 3 * w + 3].blue) >>4 ;
row_buf_p++;
}
buf_p += LV_DOWNSCALE * w;
disp_area(DISP_ID_ALL, vdb.vdb_area.x1 >> 2, y, vdb.vdb_area.x2 >> 2, y);
disp_map(DISP_ID_ALL, row_buf);
}
#else
#error "LV: Not supported LV_DOWNSCALE"
#endif
}
/**********************