mirror of
https://github.com/lvgl/lvgl.git
synced 2026-06-02 01:18:04 +08:00
feat(draw): add unified NEON acceleration (#4860)
Signed-off-by: Peter Bee <bijunda1@xiaomi.com> Co-authored-by: Gabor Kiss-Vamosi <kisvegabor@gmail.com>
This commit is contained in:
@@ -17,7 +17,9 @@
|
|||||||
#ifndef LV_CONF_H
|
#ifndef LV_CONF_H
|
||||||
#define LV_CONF_H
|
#define LV_CONF_H
|
||||||
|
|
||||||
|
#ifndef __ASSEMBLY__
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
/*====================
|
/*====================
|
||||||
COLOR SETTINGS
|
COLOR SETTINGS
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
LVGL_PATH ?= ${shell pwd}/lvgl
|
LVGL_PATH ?= ${shell pwd}/lvgl
|
||||||
|
|
||||||
|
ASRCS += $(shell find $(LVGL_PATH)/src -type f -name '*.S')
|
||||||
CSRCS += $(shell find $(LVGL_PATH)/src -type f -name '*.c')
|
CSRCS += $(shell find $(LVGL_PATH)/src -type f -name '*.c')
|
||||||
CSRCS += $(shell find $(LVGL_PATH)/demos -type f -name '*.c')
|
CSRCS += $(shell find $(LVGL_PATH)/demos -type f -name '*.c')
|
||||||
CSRCS += $(shell find $(LVGL_PATH)/examples -type f -name '*.c')
|
CSRCS += $(shell find $(LVGL_PATH)/examples -type f -name '*.c')
|
||||||
CXXSRCS += $(shell find $(LVGL_PATH)/src/libs/thorvg -type f -name '*.cpp')
|
CXXEXT := .cpp
|
||||||
CFLAGS += "-I$(LVGL_PATH)"
|
CXXSRCS += $(shell find $(LVGL_PATH)/src/libs/thorvg -type f -name '*${CXXEXT}')
|
||||||
|
|
||||||
|
AFLAGS += "-I$(LVGL_PATH)"
|
||||||
|
CFLAGS += "-I$(LVGL_PATH)"
|
||||||
|
CXXFLAGS += "-I$(LVGL_PATH)"
|
||||||
|
|||||||
@@ -150,15 +150,19 @@ fout.write(
|
|||||||
* End of parsing lv_conf_template.h
|
* End of parsing lv_conf_template.h
|
||||||
-----------------------------------*/
|
-----------------------------------*/
|
||||||
|
|
||||||
|
#ifndef __ASSEMBLY__
|
||||||
LV_EXPORT_CONST_INT(LV_DPI_DEF);
|
LV_EXPORT_CONST_INT(LV_DPI_DEF);
|
||||||
|
#endif
|
||||||
|
|
||||||
#undef _LV_KCONFIG_PRESENT
|
#undef _LV_KCONFIG_PRESENT
|
||||||
|
|
||||||
|
#ifndef __ASSEMBLY__
|
||||||
#if LV_USE_FLOAT
|
#if LV_USE_FLOAT
|
||||||
typedef float lv_value_precise_t;
|
typedef float lv_value_precise_t;
|
||||||
#else
|
#else
|
||||||
typedef int32_t lv_value_precise_t;
|
typedef int32_t lv_value_precise_t;
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
/*Set some defines if a dependency is disabled*/
|
/*Set some defines if a dependency is disabled*/
|
||||||
#if LV_USE_LOG == 0
|
#if LV_USE_LOG == 0
|
||||||
|
|||||||
@@ -16,6 +16,12 @@
|
|||||||
#include "../../../misc/lv_color.h"
|
#include "../../../misc/lv_color.h"
|
||||||
#include "../../../stdlib/lv_string.h"
|
#include "../../../stdlib/lv_string.h"
|
||||||
|
|
||||||
|
#if LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_NEON
|
||||||
|
#include "neon/lv_blend_neon.h"
|
||||||
|
#elif LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_CUSTOM
|
||||||
|
#include LV_DRAW_SW_ASM_CUSTOM_INCLUDE
|
||||||
|
#endif
|
||||||
|
|
||||||
/*********************
|
/*********************
|
||||||
* DEFINES
|
* DEFINES
|
||||||
*********************/
|
*********************/
|
||||||
@@ -78,8 +84,20 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_sw_blend_color_to_argb8888(_lv_draw_sw_blend_
|
|||||||
int32_t x;
|
int32_t x;
|
||||||
int32_t y;
|
int32_t y;
|
||||||
|
|
||||||
|
LV_UNUSED(w);
|
||||||
|
LV_UNUSED(h);
|
||||||
|
LV_UNUSED(x);
|
||||||
|
LV_UNUSED(y);
|
||||||
|
LV_UNUSED(opa);
|
||||||
|
LV_UNUSED(mask);
|
||||||
|
LV_UNUSED(mask_stride);
|
||||||
|
LV_UNUSED(dest_stride);
|
||||||
|
|
||||||
/*Simple fill*/
|
/*Simple fill*/
|
||||||
if(mask == NULL && opa >= LV_OPA_MAX) {
|
if(mask == NULL && opa >= LV_OPA_MAX) {
|
||||||
|
#ifdef LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888
|
||||||
|
LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888(dsc);
|
||||||
|
#else
|
||||||
uint32_t color32 = lv_color_to_u32(dsc->color);
|
uint32_t color32 = lv_color_to_u32(dsc->color);
|
||||||
uint32_t * dest_buf = dsc->dest_buf;
|
uint32_t * dest_buf = dsc->dest_buf;
|
||||||
for(y = 0; y < h; y++) {
|
for(y = 0; y < h; y++) {
|
||||||
@@ -110,9 +128,13 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_sw_blend_color_to_argb8888(_lv_draw_sw_blend_
|
|||||||
|
|
||||||
dest_buf = drawbuf_next_row(dest_buf, dest_stride);
|
dest_buf = drawbuf_next_row(dest_buf, dest_stride);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
/*Opacity only*/
|
/*Opacity only*/
|
||||||
else if(mask == NULL && opa < LV_OPA_MAX) {
|
else if(mask == NULL && opa < LV_OPA_MAX) {
|
||||||
|
#ifdef LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888_WITH_OPA
|
||||||
|
LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888_WITH_OPA(dsc);
|
||||||
|
#else
|
||||||
lv_color32_t color_argb = lv_color_to_32(dsc->color, opa);
|
lv_color32_t color_argb = lv_color_to_32(dsc->color, opa);
|
||||||
lv_color32_t * dest_buf = dsc->dest_buf;
|
lv_color32_t * dest_buf = dsc->dest_buf;
|
||||||
|
|
||||||
@@ -122,9 +144,13 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_sw_blend_color_to_argb8888(_lv_draw_sw_blend_
|
|||||||
}
|
}
|
||||||
dest_buf = drawbuf_next_row(dest_buf, dest_stride);
|
dest_buf = drawbuf_next_row(dest_buf, dest_stride);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
/*Masked with full opacity*/
|
/*Masked with full opacity*/
|
||||||
else if(mask && opa >= LV_OPA_MAX) {
|
else if(mask && opa >= LV_OPA_MAX) {
|
||||||
|
#ifdef LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888_WITH_MASK
|
||||||
|
LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888_WITH_MASK(dsc);
|
||||||
|
#else
|
||||||
lv_color32_t color_argb = lv_color_to_32(dsc->color, 0xff);
|
lv_color32_t color_argb = lv_color_to_32(dsc->color, 0xff);
|
||||||
lv_color32_t * dest_buf = dsc->dest_buf;
|
lv_color32_t * dest_buf = dsc->dest_buf;
|
||||||
for(y = 0; y < h; y++) {
|
for(y = 0; y < h; y++) {
|
||||||
@@ -136,9 +162,13 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_sw_blend_color_to_argb8888(_lv_draw_sw_blend_
|
|||||||
dest_buf = drawbuf_next_row(dest_buf, dest_stride);
|
dest_buf = drawbuf_next_row(dest_buf, dest_stride);
|
||||||
mask += mask_stride;
|
mask += mask_stride;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
/*Masked with opacity*/
|
/*Masked with opacity*/
|
||||||
else {
|
else {
|
||||||
|
#ifdef LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888_MIX_MASK_OPA
|
||||||
|
LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888_MIX_MASK_OPA(dsc);
|
||||||
|
#else
|
||||||
lv_color32_t color_argb = lv_color_to_32(dsc->color, opa);
|
lv_color32_t color_argb = lv_color_to_32(dsc->color, opa);
|
||||||
lv_color32_t * dest_buf = dsc->dest_buf;
|
lv_color32_t * dest_buf = dsc->dest_buf;
|
||||||
for(y = 0; y < h; y++) {
|
for(y = 0; y < h; y++) {
|
||||||
@@ -149,6 +179,7 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_sw_blend_color_to_argb8888(_lv_draw_sw_blend_
|
|||||||
dest_buf = drawbuf_next_row(dest_buf, dest_stride);
|
dest_buf = drawbuf_next_row(dest_buf, dest_stride);
|
||||||
mask += mask_stride;
|
mask += mask_stride;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -196,8 +227,18 @@ LV_ATTRIBUTE_FAST_MEM static void rgb565_image_blend(_lv_draw_sw_blend_image_dsc
|
|||||||
int32_t x;
|
int32_t x;
|
||||||
int32_t y;
|
int32_t y;
|
||||||
|
|
||||||
|
LV_UNUSED(color_argb);
|
||||||
|
|
||||||
if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) {
|
if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) {
|
||||||
if(mask_buf == NULL) {
|
if(mask_buf == NULL) {
|
||||||
|
#ifdef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888
|
||||||
|
if(opa >= LV_OPA_MAX) {
|
||||||
|
LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888(dsc);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888_WITH_OPA(dsc);
|
||||||
|
}
|
||||||
|
#else
|
||||||
color_argb.alpha = opa;
|
color_argb.alpha = opa;
|
||||||
for(y = 0; y < h; y++) {
|
for(y = 0; y < h; y++) {
|
||||||
for(x = 0; x < w; x++) {
|
for(x = 0; x < w; x++) {
|
||||||
@@ -209,8 +250,12 @@ LV_ATTRIBUTE_FAST_MEM static void rgb565_image_blend(_lv_draw_sw_blend_image_dsc
|
|||||||
dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride);
|
dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride);
|
||||||
src_buf_c16 = drawbuf_next_row(src_buf_c16, src_stride);
|
src_buf_c16 = drawbuf_next_row(src_buf_c16, src_stride);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else if(mask_buf && opa >= LV_OPA_MAX) {
|
else if(mask_buf && opa >= LV_OPA_MAX) {
|
||||||
|
#ifdef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888_WITH_MASK
|
||||||
|
LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888_WITH_MASK(dsc);
|
||||||
|
#else
|
||||||
for(y = 0; y < h; y++) {
|
for(y = 0; y < h; y++) {
|
||||||
for(x = 0; x < w; x++) {
|
for(x = 0; x < w; x++) {
|
||||||
color_argb.alpha = mask_buf[x];
|
color_argb.alpha = mask_buf[x];
|
||||||
@@ -223,8 +268,12 @@ LV_ATTRIBUTE_FAST_MEM static void rgb565_image_blend(_lv_draw_sw_blend_image_dsc
|
|||||||
src_buf_c16 = drawbuf_next_row(src_buf_c16, src_stride);
|
src_buf_c16 = drawbuf_next_row(src_buf_c16, src_stride);
|
||||||
mask_buf += mask_stride;
|
mask_buf += mask_stride;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
#ifdef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA
|
||||||
|
LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA(dsc);
|
||||||
|
#else
|
||||||
for(y = 0; y < h; y++) {
|
for(y = 0; y < h; y++) {
|
||||||
for(x = 0; x < w; x++) {
|
for(x = 0; x < w; x++) {
|
||||||
color_argb.alpha = LV_OPA_MIX2(mask_buf[x], opa);
|
color_argb.alpha = LV_OPA_MIX2(mask_buf[x], opa);
|
||||||
@@ -237,6 +286,7 @@ LV_ATTRIBUTE_FAST_MEM static void rgb565_image_blend(_lv_draw_sw_blend_image_dsc
|
|||||||
src_buf_c16 = drawbuf_next_row(src_buf_c16, src_stride);
|
src_buf_c16 = drawbuf_next_row(src_buf_c16, src_stride);
|
||||||
mask_buf += mask_stride;
|
mask_buf += mask_stride;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -278,9 +328,14 @@ LV_ATTRIBUTE_FAST_MEM static void rgb888_image_blend(_lv_draw_sw_blend_image_dsc
|
|||||||
int32_t src_x;
|
int32_t src_x;
|
||||||
int32_t y;
|
int32_t y;
|
||||||
|
|
||||||
|
LV_UNUSED(color_argb);
|
||||||
|
|
||||||
if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) {
|
if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) {
|
||||||
/*Special case*/
|
/*Special case*/
|
||||||
if(mask_buf == NULL && opa >= LV_OPA_MAX) {
|
if(mask_buf == NULL && opa >= LV_OPA_MAX) {
|
||||||
|
#ifdef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888
|
||||||
|
LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888(dsc, src_px_size);
|
||||||
|
#else
|
||||||
if(src_px_size == 4) {
|
if(src_px_size == 4) {
|
||||||
uint32_t line_in_bytes = w * 4;
|
uint32_t line_in_bytes = w * 4;
|
||||||
for(y = 0; y < h; y++) {
|
for(y = 0; y < h; y++) {
|
||||||
@@ -301,8 +356,12 @@ LV_ATTRIBUTE_FAST_MEM static void rgb888_image_blend(_lv_draw_sw_blend_image_dsc
|
|||||||
src_buf = drawbuf_next_row(src_buf, src_stride);
|
src_buf = drawbuf_next_row(src_buf, src_stride);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
if(mask_buf == NULL && opa < LV_OPA_MAX) {
|
if(mask_buf == NULL && opa < LV_OPA_MAX) {
|
||||||
|
#ifdef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888_WITH_OPA
|
||||||
|
LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888_WITH_OPA(dsc, src_px_size);
|
||||||
|
#else
|
||||||
color_argb.alpha = opa;
|
color_argb.alpha = opa;
|
||||||
for(y = 0; y < h; y++) {
|
for(y = 0; y < h; y++) {
|
||||||
for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x += src_px_size) {
|
for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x += src_px_size) {
|
||||||
@@ -314,8 +373,12 @@ LV_ATTRIBUTE_FAST_MEM static void rgb888_image_blend(_lv_draw_sw_blend_image_dsc
|
|||||||
dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride);
|
dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride);
|
||||||
src_buf = drawbuf_next_row(src_buf, src_stride);
|
src_buf = drawbuf_next_row(src_buf, src_stride);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
if(mask_buf && opa >= LV_OPA_MAX) {
|
if(mask_buf && opa >= LV_OPA_MAX) {
|
||||||
|
#ifdef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888_WITH_MASK
|
||||||
|
LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888_WITH_MASK(dsc, src_px_size);
|
||||||
|
#else
|
||||||
for(y = 0; y < h; y++) {
|
for(y = 0; y < h; y++) {
|
||||||
for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x += src_px_size) {
|
for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x += src_px_size) {
|
||||||
color_argb.alpha = mask_buf[dest_x];
|
color_argb.alpha = mask_buf[dest_x];
|
||||||
@@ -328,8 +391,12 @@ LV_ATTRIBUTE_FAST_MEM static void rgb888_image_blend(_lv_draw_sw_blend_image_dsc
|
|||||||
src_buf = drawbuf_next_row(src_buf, src_stride);
|
src_buf = drawbuf_next_row(src_buf, src_stride);
|
||||||
mask_buf += mask_stride;
|
mask_buf += mask_stride;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
if(mask_buf && opa < LV_OPA_MAX) {
|
if(mask_buf && opa < LV_OPA_MAX) {
|
||||||
|
#ifdef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA
|
||||||
|
LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA(dsc, src_px_size);
|
||||||
|
#else
|
||||||
for(y = 0; y < h; y++) {
|
for(y = 0; y < h; y++) {
|
||||||
for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x += src_px_size) {
|
for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x += src_px_size) {
|
||||||
color_argb.alpha = (opa * mask_buf[dest_x]) >> 8;
|
color_argb.alpha = (opa * mask_buf[dest_x]) >> 8;
|
||||||
@@ -342,6 +409,7 @@ LV_ATTRIBUTE_FAST_MEM static void rgb888_image_blend(_lv_draw_sw_blend_image_dsc
|
|||||||
src_buf = drawbuf_next_row(src_buf, src_stride);
|
src_buf = drawbuf_next_row(src_buf, src_stride);
|
||||||
mask_buf += mask_stride;
|
mask_buf += mask_stride;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -384,6 +452,9 @@ LV_ATTRIBUTE_FAST_MEM static void argb8888_image_blend(_lv_draw_sw_blend_image_d
|
|||||||
|
|
||||||
if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) {
|
if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) {
|
||||||
if(mask_buf == NULL && opa >= LV_OPA_MAX) {
|
if(mask_buf == NULL && opa >= LV_OPA_MAX) {
|
||||||
|
#ifdef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888
|
||||||
|
LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888(dsc);
|
||||||
|
#else
|
||||||
for(y = 0; y < h; y++) {
|
for(y = 0; y < h; y++) {
|
||||||
for(x = 0; x < w; x++) {
|
for(x = 0; x < w; x++) {
|
||||||
dest_buf_c32[x] = lv_color_32_32_mix(src_buf_c32[x], dest_buf_c32[x], &cache);
|
dest_buf_c32[x] = lv_color_32_32_mix(src_buf_c32[x], dest_buf_c32[x], &cache);
|
||||||
@@ -391,8 +462,12 @@ LV_ATTRIBUTE_FAST_MEM static void argb8888_image_blend(_lv_draw_sw_blend_image_d
|
|||||||
dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride);
|
dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride);
|
||||||
src_buf_c32 = drawbuf_next_row(src_buf_c32, src_stride);
|
src_buf_c32 = drawbuf_next_row(src_buf_c32, src_stride);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else if(mask_buf == NULL && opa < LV_OPA_MAX) {
|
else if(mask_buf == NULL && opa < LV_OPA_MAX) {
|
||||||
|
#ifdef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888_WITH_OPA
|
||||||
|
LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888_WITH_OPA(dsc);
|
||||||
|
#else
|
||||||
for(y = 0; y < h; y++) {
|
for(y = 0; y < h; y++) {
|
||||||
for(x = 0; x < w; x++) {
|
for(x = 0; x < w; x++) {
|
||||||
color_argb = src_buf_c32[x];
|
color_argb = src_buf_c32[x];
|
||||||
@@ -402,8 +477,12 @@ LV_ATTRIBUTE_FAST_MEM static void argb8888_image_blend(_lv_draw_sw_blend_image_d
|
|||||||
dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride);
|
dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride);
|
||||||
src_buf_c32 = drawbuf_next_row(src_buf_c32, src_stride);
|
src_buf_c32 = drawbuf_next_row(src_buf_c32, src_stride);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else if(mask_buf && opa >= LV_OPA_MAX) {
|
else if(mask_buf && opa >= LV_OPA_MAX) {
|
||||||
|
#ifdef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888_WITH_MASK
|
||||||
|
LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888_WITH_MASK(dsc);
|
||||||
|
#else
|
||||||
for(y = 0; y < h; y++) {
|
for(y = 0; y < h; y++) {
|
||||||
for(x = 0; x < w; x++) {
|
for(x = 0; x < w; x++) {
|
||||||
color_argb = src_buf_c32[x];
|
color_argb = src_buf_c32[x];
|
||||||
@@ -414,8 +493,12 @@ LV_ATTRIBUTE_FAST_MEM static void argb8888_image_blend(_lv_draw_sw_blend_image_d
|
|||||||
src_buf_c32 = drawbuf_next_row(src_buf_c32, src_stride);
|
src_buf_c32 = drawbuf_next_row(src_buf_c32, src_stride);
|
||||||
mask_buf += mask_stride;
|
mask_buf += mask_stride;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else if(mask_buf && opa < LV_OPA_MAX) {
|
else if(mask_buf && opa < LV_OPA_MAX) {
|
||||||
|
#ifdef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA
|
||||||
|
LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA(dsc);
|
||||||
|
#else
|
||||||
for(y = 0; y < h; y++) {
|
for(y = 0; y < h; y++) {
|
||||||
for(x = 0; x < w; x++) {
|
for(x = 0; x < w; x++) {
|
||||||
color_argb = src_buf_c32[x];
|
color_argb = src_buf_c32[x];
|
||||||
@@ -426,6 +509,7 @@ LV_ATTRIBUTE_FAST_MEM static void argb8888_image_blend(_lv_draw_sw_blend_image_d
|
|||||||
src_buf_c32 = drawbuf_next_row(src_buf_c32, src_stride);
|
src_buf_c32 = drawbuf_next_row(src_buf_c32, src_stride);
|
||||||
mask_buf += mask_stride;
|
mask_buf += mask_stride;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @file lv_draw_sw_blend.c
|
* @file lv_draw_sw_blend_to_rgb565.c
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -16,6 +16,12 @@
|
|||||||
#include "../../../misc/lv_color.h"
|
#include "../../../misc/lv_color.h"
|
||||||
#include "../../../stdlib/lv_string.h"
|
#include "../../../stdlib/lv_string.h"
|
||||||
|
|
||||||
|
#if LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_NEON
|
||||||
|
#include "neon/lv_blend_neon.h"
|
||||||
|
#elif LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_CUSTOM
|
||||||
|
#include LV_DRAW_SW_ASM_CUSTOM_INCLUDE
|
||||||
|
#endif
|
||||||
|
|
||||||
/*********************
|
/*********************
|
||||||
* DEFINES
|
* DEFINES
|
||||||
*********************/
|
*********************/
|
||||||
@@ -77,8 +83,22 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_sw_blend_color_to_rgb565(_lv_draw_sw_blend_fi
|
|||||||
int32_t x;
|
int32_t x;
|
||||||
int32_t y;
|
int32_t y;
|
||||||
|
|
||||||
|
LV_UNUSED(w);
|
||||||
|
LV_UNUSED(h);
|
||||||
|
LV_UNUSED(x);
|
||||||
|
LV_UNUSED(y);
|
||||||
|
LV_UNUSED(opa);
|
||||||
|
LV_UNUSED(mask);
|
||||||
|
LV_UNUSED(color16);
|
||||||
|
LV_UNUSED(mask_stride);
|
||||||
|
LV_UNUSED(dest_stride);
|
||||||
|
LV_UNUSED(dest_buf_u16);
|
||||||
|
|
||||||
/*Simple fill*/
|
/*Simple fill*/
|
||||||
if(mask == NULL && opa >= LV_OPA_MAX) {
|
if(mask == NULL && opa >= LV_OPA_MAX) {
|
||||||
|
#ifdef LV_DRAW_SW_COLOR_BLEND_TO_RGB565
|
||||||
|
LV_DRAW_SW_COLOR_BLEND_TO_RGB565(dsc);
|
||||||
|
#else
|
||||||
for(y = 0; y < h; y++) {
|
for(y = 0; y < h; y++) {
|
||||||
uint16_t * dest_end_final = dest_buf_u16 + w;
|
uint16_t * dest_end_final = dest_buf_u16 + w;
|
||||||
uint32_t * dest_end_mid = (uint32_t *)((uint16_t *) dest_buf_u16 + ((w - 1) & ~(0xF)));
|
uint32_t * dest_end_mid = (uint32_t *)((uint16_t *) dest_buf_u16 + ((w - 1) & ~(0xF)));
|
||||||
@@ -111,9 +131,13 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_sw_blend_color_to_rgb565(_lv_draw_sw_blend_fi
|
|||||||
dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride);
|
dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride);
|
||||||
dest_buf_u16 -= w;
|
dest_buf_u16 -= w;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
/*Opacity only*/
|
/*Opacity only*/
|
||||||
else if(mask == NULL && opa < LV_OPA_MAX) {
|
else if(mask == NULL && opa < LV_OPA_MAX) {
|
||||||
|
#ifdef LV_DRAW_SW_COLOR_BLEND_TO_RGB565_WITH_OPA
|
||||||
|
LV_DRAW_SW_COLOR_BLEND_TO_RGB565_WITH_OPA(dsc);
|
||||||
|
#else
|
||||||
uint32_t last_dest32_color = dest_buf_u16[0] + 1; /*Set to value which is not equal to the first pixel*/
|
uint32_t last_dest32_color = dest_buf_u16[0] + 1; /*Set to value which is not equal to the first pixel*/
|
||||||
uint32_t last_res32_color = 0;
|
uint32_t last_res32_color = 0;
|
||||||
|
|
||||||
@@ -150,10 +174,14 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_sw_blend_color_to_rgb565(_lv_draw_sw_blend_fi
|
|||||||
}
|
}
|
||||||
dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride);
|
dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Masked with full opacity*/
|
/*Masked with full opacity*/
|
||||||
else if(mask && opa >= LV_OPA_MAX) {
|
else if(mask && opa >= LV_OPA_MAX) {
|
||||||
|
#ifdef LV_DRAW_SW_COLOR_BLEND_TO_RGB565_WITH_MASK
|
||||||
|
LV_DRAW_SW_COLOR_BLEND_TO_RGB565_WITH_MASK(dsc);
|
||||||
|
#else
|
||||||
uint32_t c32 = color16 + ((uint32_t)color16 << 16);
|
uint32_t c32 = color16 + ((uint32_t)color16 << 16);
|
||||||
for(y = 0; y < h; y++) {
|
for(y = 0; y < h; y++) {
|
||||||
for(x = 0; x < w && ((lv_uintptr_t)(mask) & 0x3); x++) {
|
for(x = 0; x < w && ((lv_uintptr_t)(mask) & 0x3); x++) {
|
||||||
@@ -189,9 +217,13 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_sw_blend_color_to_rgb565(_lv_draw_sw_blend_fi
|
|||||||
dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride);
|
dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride);
|
||||||
mask += mask_stride;
|
mask += mask_stride;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
/*Masked with opacity*/
|
/*Masked with opacity*/
|
||||||
else if(mask && opa < LV_OPA_MAX) {
|
else if(mask && opa < LV_OPA_MAX) {
|
||||||
|
#ifdef LV_DRAW_SW_COLOR_BLEND_TO_RGB565_MIX_MASK_OPA
|
||||||
|
LV_DRAW_SW_COLOR_BLEND_TO_RGB565_MIX_MASK_OPA(dsc);
|
||||||
|
#else
|
||||||
for(y = 0; y < h; y++) {
|
for(y = 0; y < h; y++) {
|
||||||
for(x = 0; x < w; x++) {
|
for(x = 0; x < w; x++) {
|
||||||
dest_buf_u16[x] = lv_color_16_16_mix(color16, dest_buf_u16[x], LV_OPA_MIX2(mask[x], opa));
|
dest_buf_u16[x] = lv_color_16_16_mix(color16, dest_buf_u16[x], LV_OPA_MIX2(mask[x], opa));
|
||||||
@@ -199,6 +231,7 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_sw_blend_color_to_rgb565(_lv_draw_sw_blend_fi
|
|||||||
dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride);
|
dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride);
|
||||||
mask += mask_stride;
|
mask += mask_stride;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -244,14 +277,21 @@ LV_ATTRIBUTE_FAST_MEM static void rgb565_image_blend(_lv_draw_sw_blend_image_dsc
|
|||||||
|
|
||||||
if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) {
|
if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) {
|
||||||
if(mask_buf == NULL && opa >= LV_OPA_MAX) {
|
if(mask_buf == NULL && opa >= LV_OPA_MAX) {
|
||||||
|
#ifdef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565
|
||||||
|
LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565(dsc);
|
||||||
|
#else
|
||||||
uint32_t line_in_bytes = w * 2;
|
uint32_t line_in_bytes = w * 2;
|
||||||
for(y = 0; y < h; y++) {
|
for(y = 0; y < h; y++) {
|
||||||
lv_memcpy(dest_buf_u16, src_buf_u16, line_in_bytes);
|
lv_memcpy(dest_buf_u16, src_buf_u16, line_in_bytes);
|
||||||
dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride);
|
dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride);
|
||||||
src_buf_u16 = drawbuf_next_row(src_buf_u16, src_stride);
|
src_buf_u16 = drawbuf_next_row(src_buf_u16, src_stride);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else if(mask_buf == NULL && opa < LV_OPA_MAX) {
|
else if(mask_buf == NULL && opa < LV_OPA_MAX) {
|
||||||
|
#ifdef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565_WITH_OPA
|
||||||
|
LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565_WITH_OPA(dsc);
|
||||||
|
#else
|
||||||
for(y = 0; y < h; y++) {
|
for(y = 0; y < h; y++) {
|
||||||
for(x = 0; x < w; x++) {
|
for(x = 0; x < w; x++) {
|
||||||
dest_buf_u16[x] = lv_color_16_16_mix(src_buf_u16[x], dest_buf_u16[x], opa);
|
dest_buf_u16[x] = lv_color_16_16_mix(src_buf_u16[x], dest_buf_u16[x], opa);
|
||||||
@@ -259,8 +299,12 @@ LV_ATTRIBUTE_FAST_MEM static void rgb565_image_blend(_lv_draw_sw_blend_image_dsc
|
|||||||
dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride);
|
dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride);
|
||||||
src_buf_u16 = drawbuf_next_row(src_buf_u16, src_stride);
|
src_buf_u16 = drawbuf_next_row(src_buf_u16, src_stride);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else if(mask_buf && opa >= LV_OPA_MAX) {
|
else if(mask_buf && opa >= LV_OPA_MAX) {
|
||||||
|
#ifdef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565_WITH_MASK
|
||||||
|
LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565_WITH_MASK(dsc);
|
||||||
|
#else
|
||||||
for(y = 0; y < h; y++) {
|
for(y = 0; y < h; y++) {
|
||||||
for(x = 0; x < w; x++) {
|
for(x = 0; x < w; x++) {
|
||||||
dest_buf_u16[x] = lv_color_16_16_mix(src_buf_u16[x], dest_buf_u16[x], mask_buf[x]);
|
dest_buf_u16[x] = lv_color_16_16_mix(src_buf_u16[x], dest_buf_u16[x], mask_buf[x]);
|
||||||
@@ -269,8 +313,12 @@ LV_ATTRIBUTE_FAST_MEM static void rgb565_image_blend(_lv_draw_sw_blend_image_dsc
|
|||||||
src_buf_u16 = drawbuf_next_row(src_buf_u16, src_stride);
|
src_buf_u16 = drawbuf_next_row(src_buf_u16, src_stride);
|
||||||
mask_buf += mask_stride;
|
mask_buf += mask_stride;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
#ifdef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA
|
||||||
|
LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA(dsc);
|
||||||
|
#else
|
||||||
for(y = 0; y < h; y++) {
|
for(y = 0; y < h; y++) {
|
||||||
for(x = 0; x < w; x++) {
|
for(x = 0; x < w; x++) {
|
||||||
dest_buf_u16[x] = lv_color_16_16_mix(src_buf_u16[x], dest_buf_u16[x], LV_OPA_MIX2(mask_buf[x], opa));
|
dest_buf_u16[x] = lv_color_16_16_mix(src_buf_u16[x], dest_buf_u16[x], LV_OPA_MIX2(mask_buf[x], opa));
|
||||||
@@ -279,6 +327,7 @@ LV_ATTRIBUTE_FAST_MEM static void rgb565_image_blend(_lv_draw_sw_blend_image_dsc
|
|||||||
src_buf_u16 = drawbuf_next_row(src_buf_u16, src_stride);
|
src_buf_u16 = drawbuf_next_row(src_buf_u16, src_stride);
|
||||||
mask_buf += mask_stride;
|
mask_buf += mask_stride;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -345,6 +394,9 @@ LV_ATTRIBUTE_FAST_MEM static void rgb888_image_blend(_lv_draw_sw_blend_image_dsc
|
|||||||
|
|
||||||
if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) {
|
if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) {
|
||||||
if(mask_buf == NULL && opa >= LV_OPA_MAX) {
|
if(mask_buf == NULL && opa >= LV_OPA_MAX) {
|
||||||
|
#ifdef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565
|
||||||
|
LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565(dsc, src_px_size);
|
||||||
|
#else
|
||||||
for(y = 0; y < h; y++) {
|
for(y = 0; y < h; y++) {
|
||||||
for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x += src_px_size) {
|
for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x += src_px_size) {
|
||||||
dest_buf_u16[dest_x] = ((src_buf_u8[src_x + 2] & 0xF8) << 8) +
|
dest_buf_u16[dest_x] = ((src_buf_u8[src_x + 2] & 0xF8) << 8) +
|
||||||
@@ -354,8 +406,12 @@ LV_ATTRIBUTE_FAST_MEM static void rgb888_image_blend(_lv_draw_sw_blend_image_dsc
|
|||||||
dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride);
|
dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride);
|
||||||
src_buf_u8 += src_stride;
|
src_buf_u8 += src_stride;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else if(mask_buf == NULL && opa < LV_OPA_MAX) {
|
else if(mask_buf == NULL && opa < LV_OPA_MAX) {
|
||||||
|
#ifdef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565_WITH_OPA
|
||||||
|
LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565_WITH_OPA(dsc, src_px_size);
|
||||||
|
#else
|
||||||
for(y = 0; y < h; y++) {
|
for(y = 0; y < h; y++) {
|
||||||
for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x += src_px_size) {
|
for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x += src_px_size) {
|
||||||
dest_buf_u16[dest_x] = lv_color_24_16_mix(&src_buf_u8[src_x], dest_buf_u16[dest_x], opa);
|
dest_buf_u16[dest_x] = lv_color_24_16_mix(&src_buf_u8[src_x], dest_buf_u16[dest_x], opa);
|
||||||
@@ -363,8 +419,12 @@ LV_ATTRIBUTE_FAST_MEM static void rgb888_image_blend(_lv_draw_sw_blend_image_dsc
|
|||||||
dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride);
|
dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride);
|
||||||
src_buf_u8 += src_stride;
|
src_buf_u8 += src_stride;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
if(mask_buf && opa >= LV_OPA_MAX) {
|
if(mask_buf && opa >= LV_OPA_MAX) {
|
||||||
|
#ifdef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565_WITH_MASK
|
||||||
|
LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565_WITH_MASK(dsc, src_px_size);
|
||||||
|
#else
|
||||||
for(y = 0; y < h; y++) {
|
for(y = 0; y < h; y++) {
|
||||||
for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x += src_px_size) {
|
for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x += src_px_size) {
|
||||||
dest_buf_u16[dest_x] = lv_color_24_16_mix(&src_buf_u8[src_x], dest_buf_u16[dest_x], mask_buf[dest_x]);
|
dest_buf_u16[dest_x] = lv_color_24_16_mix(&src_buf_u8[src_x], dest_buf_u16[dest_x], mask_buf[dest_x]);
|
||||||
@@ -373,8 +433,12 @@ LV_ATTRIBUTE_FAST_MEM static void rgb888_image_blend(_lv_draw_sw_blend_image_dsc
|
|||||||
src_buf_u8 += src_stride;
|
src_buf_u8 += src_stride;
|
||||||
mask_buf += mask_stride;
|
mask_buf += mask_stride;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
if(mask_buf && opa < LV_OPA_MAX) {
|
if(mask_buf && opa < LV_OPA_MAX) {
|
||||||
|
#ifdef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA
|
||||||
|
LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA(dsc, src_px_size);
|
||||||
|
#else
|
||||||
for(y = 0; y < h; y++) {
|
for(y = 0; y < h; y++) {
|
||||||
for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x += src_px_size) {
|
for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x += src_px_size) {
|
||||||
dest_buf_u16[dest_x] = lv_color_24_16_mix(&src_buf_u8[src_x], dest_buf_u16[dest_x], LV_OPA_MIX2(mask_buf[dest_x], opa));
|
dest_buf_u16[dest_x] = lv_color_24_16_mix(&src_buf_u8[src_x], dest_buf_u16[dest_x], LV_OPA_MIX2(mask_buf[dest_x], opa));
|
||||||
@@ -383,6 +447,7 @@ LV_ATTRIBUTE_FAST_MEM static void rgb888_image_blend(_lv_draw_sw_blend_image_dsc
|
|||||||
src_buf_u8 += src_stride;
|
src_buf_u8 += src_stride;
|
||||||
mask_buf += mask_stride;
|
mask_buf += mask_stride;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -445,6 +510,9 @@ LV_ATTRIBUTE_FAST_MEM static void argb8888_image_blend(_lv_draw_sw_blend_image_d
|
|||||||
|
|
||||||
if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) {
|
if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) {
|
||||||
if(mask_buf == NULL && opa >= LV_OPA_MAX) {
|
if(mask_buf == NULL && opa >= LV_OPA_MAX) {
|
||||||
|
#ifdef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565
|
||||||
|
LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565(dsc);
|
||||||
|
#else
|
||||||
for(y = 0; y < h; y++) {
|
for(y = 0; y < h; y++) {
|
||||||
for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x += 4) {
|
for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x += 4) {
|
||||||
dest_buf_u16[dest_x] = lv_color_24_16_mix(&src_buf_u8[src_x], dest_buf_u16[dest_x], src_buf_u8[src_x + 3]);
|
dest_buf_u16[dest_x] = lv_color_24_16_mix(&src_buf_u8[src_x], dest_buf_u16[dest_x], src_buf_u8[src_x + 3]);
|
||||||
@@ -452,8 +520,12 @@ LV_ATTRIBUTE_FAST_MEM static void argb8888_image_blend(_lv_draw_sw_blend_image_d
|
|||||||
dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride);
|
dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride);
|
||||||
src_buf_u8 += src_stride;
|
src_buf_u8 += src_stride;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else if(mask_buf == NULL && opa < LV_OPA_MAX) {
|
else if(mask_buf == NULL && opa < LV_OPA_MAX) {
|
||||||
|
#ifdef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565_WITH_OPA
|
||||||
|
LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565_WITH_OPA(dsc);
|
||||||
|
#else
|
||||||
for(y = 0; y < h; y++) {
|
for(y = 0; y < h; y++) {
|
||||||
for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x += 4) {
|
for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x += 4) {
|
||||||
dest_buf_u16[dest_x] = lv_color_24_16_mix(&src_buf_u8[src_x], dest_buf_u16[dest_x], LV_OPA_MIX2(src_buf_u8[src_x + 3],
|
dest_buf_u16[dest_x] = lv_color_24_16_mix(&src_buf_u8[src_x], dest_buf_u16[dest_x], LV_OPA_MIX2(src_buf_u8[src_x + 3],
|
||||||
@@ -462,8 +534,12 @@ LV_ATTRIBUTE_FAST_MEM static void argb8888_image_blend(_lv_draw_sw_blend_image_d
|
|||||||
dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride);
|
dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride);
|
||||||
src_buf_u8 += src_stride;
|
src_buf_u8 += src_stride;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else if(mask_buf && opa >= LV_OPA_MAX) {
|
else if(mask_buf && opa >= LV_OPA_MAX) {
|
||||||
|
#ifdef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565_WITH_MASK
|
||||||
|
LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565_WITH_MASK(dsc);
|
||||||
|
#else
|
||||||
for(y = 0; y < h; y++) {
|
for(y = 0; y < h; y++) {
|
||||||
for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x += 4) {
|
for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x += 4) {
|
||||||
dest_buf_u16[dest_x] = lv_color_24_16_mix(&src_buf_u8[src_x], dest_buf_u16[dest_x],
|
dest_buf_u16[dest_x] = lv_color_24_16_mix(&src_buf_u8[src_x], dest_buf_u16[dest_x],
|
||||||
@@ -473,8 +549,12 @@ LV_ATTRIBUTE_FAST_MEM static void argb8888_image_blend(_lv_draw_sw_blend_image_d
|
|||||||
src_buf_u8 += src_stride;
|
src_buf_u8 += src_stride;
|
||||||
mask_buf += mask_stride;
|
mask_buf += mask_stride;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else if(mask_buf && opa < LV_OPA_MAX) {
|
else if(mask_buf && opa < LV_OPA_MAX) {
|
||||||
|
#ifdef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA
|
||||||
|
LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA(dsc);
|
||||||
|
#else
|
||||||
for(y = 0; y < h; y++) {
|
for(y = 0; y < h; y++) {
|
||||||
for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x += 4) {
|
for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x += 4) {
|
||||||
dest_buf_u16[dest_x] = lv_color_24_16_mix(&src_buf_u8[src_x], dest_buf_u16[dest_x],
|
dest_buf_u16[dest_x] = lv_color_24_16_mix(&src_buf_u8[src_x], dest_buf_u16[dest_x],
|
||||||
@@ -484,6 +564,7 @@ LV_ATTRIBUTE_FAST_MEM static void argb8888_image_blend(_lv_draw_sw_blend_image_d
|
|||||||
src_buf_u8 += src_stride;
|
src_buf_u8 += src_stride;
|
||||||
mask_buf += mask_stride;
|
mask_buf += mask_stride;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @file lv_draw_sw_blend_rgb888.c
|
* @file lv_draw_sw_blend_to_rgb888.c
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
#include "../../../stdlib/lv_string.h"
|
#include "../../../stdlib/lv_string.h"
|
||||||
|
|
||||||
#if LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_NEON
|
#if LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_NEON
|
||||||
#include "neon/lv_blend_to_rgb888_neon.h"
|
#include "neon/lv_blend_neon.h"
|
||||||
#elif LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_CUSTOM
|
#elif LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_CUSTOM
|
||||||
#include LV_DRAW_SW_ASM_CUSTOM_INCLUDE
|
#include LV_DRAW_SW_ASM_CUSTOM_INCLUDE
|
||||||
#endif
|
#endif
|
||||||
@@ -237,6 +237,9 @@ LV_ATTRIBUTE_FAST_MEM static void rgb565_image_blend(_lv_draw_sw_blend_image_dsc
|
|||||||
|
|
||||||
if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) {
|
if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) {
|
||||||
if(mask_buf == NULL && opa >= LV_OPA_MAX) {
|
if(mask_buf == NULL && opa >= LV_OPA_MAX) {
|
||||||
|
#ifdef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888
|
||||||
|
LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888(dsc, dest_px_size);
|
||||||
|
#else
|
||||||
for(y = 0; y < h; y++) {
|
for(y = 0; y < h; y++) {
|
||||||
for(src_x = 0, dest_x = 0; src_x < w; dest_x += dest_px_size, src_x++) {
|
for(src_x = 0, dest_x = 0; src_x < w; dest_x += dest_px_size, src_x++) {
|
||||||
dest_buf_u8[dest_x + 2] = (src_buf_c16[src_x].red * 2106) >> 8; /*To make it rounded*/
|
dest_buf_u8[dest_x + 2] = (src_buf_c16[src_x].red * 2106) >> 8; /*To make it rounded*/
|
||||||
@@ -246,8 +249,12 @@ LV_ATTRIBUTE_FAST_MEM static void rgb565_image_blend(_lv_draw_sw_blend_image_dsc
|
|||||||
dest_buf_u8 += dest_stride;
|
dest_buf_u8 += dest_stride;
|
||||||
src_buf_c16 = drawbuf_next_row(src_buf_c16, src_stride);
|
src_buf_c16 = drawbuf_next_row(src_buf_c16, src_stride);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else if(mask_buf == NULL && opa < LV_OPA_MAX) {
|
else if(mask_buf == NULL && opa < LV_OPA_MAX) {
|
||||||
|
#ifdef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888_WITH_OPA
|
||||||
|
LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888_WITH_OPA(dsc, dest_px_size);
|
||||||
|
#else
|
||||||
uint8_t res[3];
|
uint8_t res[3];
|
||||||
for(y = 0; y < h; y++) {
|
for(y = 0; y < h; y++) {
|
||||||
for(src_x = 0, dest_x = 0; src_x < w; dest_x += dest_px_size, src_x++) {
|
for(src_x = 0, dest_x = 0; src_x < w; dest_x += dest_px_size, src_x++) {
|
||||||
@@ -259,8 +266,12 @@ LV_ATTRIBUTE_FAST_MEM static void rgb565_image_blend(_lv_draw_sw_blend_image_dsc
|
|||||||
dest_buf_u8 += dest_stride;
|
dest_buf_u8 += dest_stride;
|
||||||
src_buf_c16 = drawbuf_next_row(src_buf_c16, src_stride);
|
src_buf_c16 = drawbuf_next_row(src_buf_c16, src_stride);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else if(mask_buf && opa >= LV_OPA_MAX) {
|
else if(mask_buf && opa >= LV_OPA_MAX) {
|
||||||
|
#ifdef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888_WITH_MASK
|
||||||
|
LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888_WITH_MASK(dsc, dest_px_size);
|
||||||
|
#else
|
||||||
uint8_t res[3];
|
uint8_t res[3];
|
||||||
for(y = 0; y < h; y++) {
|
for(y = 0; y < h; y++) {
|
||||||
for(src_x = 0, dest_x = 0; src_x < w; dest_x += dest_px_size, src_x++) {
|
for(src_x = 0, dest_x = 0; src_x < w; dest_x += dest_px_size, src_x++) {
|
||||||
@@ -273,8 +284,12 @@ LV_ATTRIBUTE_FAST_MEM static void rgb565_image_blend(_lv_draw_sw_blend_image_dsc
|
|||||||
src_buf_c16 = drawbuf_next_row(src_buf_c16, src_stride);
|
src_buf_c16 = drawbuf_next_row(src_buf_c16, src_stride);
|
||||||
mask_buf += mask_stride;
|
mask_buf += mask_stride;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
#ifdef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA
|
||||||
|
LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA(dsc, dest_px_size);
|
||||||
|
#else
|
||||||
uint8_t res[3];
|
uint8_t res[3];
|
||||||
for(y = 0; y < h; y++) {
|
for(y = 0; y < h; y++) {
|
||||||
for(src_x = 0, dest_x = 0; src_x < w; dest_x += dest_px_size, src_x++) {
|
for(src_x = 0, dest_x = 0; src_x < w; dest_x += dest_px_size, src_x++) {
|
||||||
@@ -287,6 +302,7 @@ LV_ATTRIBUTE_FAST_MEM static void rgb565_image_blend(_lv_draw_sw_blend_image_dsc
|
|||||||
src_buf_c16 = drawbuf_next_row(src_buf_c16, src_stride);
|
src_buf_c16 = drawbuf_next_row(src_buf_c16, src_stride);
|
||||||
mask_buf += mask_stride;
|
mask_buf += mask_stride;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -327,6 +343,9 @@ LV_ATTRIBUTE_FAST_MEM static void rgb888_image_blend(_lv_draw_sw_blend_image_dsc
|
|||||||
if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) {
|
if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) {
|
||||||
/*Special case*/
|
/*Special case*/
|
||||||
if(mask_buf == NULL && opa >= LV_OPA_MAX) {
|
if(mask_buf == NULL && opa >= LV_OPA_MAX) {
|
||||||
|
#ifdef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888
|
||||||
|
LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888(dsc, dest_px_size, src_px_size);
|
||||||
|
#else
|
||||||
if(src_px_size == dest_px_size) {
|
if(src_px_size == dest_px_size) {
|
||||||
for(y = 0; y < h; y++) {
|
for(y = 0; y < h; y++) {
|
||||||
lv_memcpy(dest_buf, src_buf, w);
|
lv_memcpy(dest_buf, src_buf, w);
|
||||||
@@ -345,8 +364,12 @@ LV_ATTRIBUTE_FAST_MEM static void rgb888_image_blend(_lv_draw_sw_blend_image_dsc
|
|||||||
src_buf += src_stride;
|
src_buf += src_stride;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
if(mask_buf == NULL && opa < LV_OPA_MAX) {
|
if(mask_buf == NULL && opa < LV_OPA_MAX) {
|
||||||
|
#ifdef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888_WITH_OPA
|
||||||
|
LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888_WITH_OPA(dsc, dest_px_size, src_px_size);
|
||||||
|
#else
|
||||||
for(y = 0; y < h; y++) {
|
for(y = 0; y < h; y++) {
|
||||||
for(dest_x = 0, src_x = 0; dest_x < w; dest_x += dest_px_size, src_x += src_px_size) {
|
for(dest_x = 0, src_x = 0; dest_x < w; dest_x += dest_px_size, src_x += src_px_size) {
|
||||||
lv_color_24_24_mix(&src_buf[src_x], &dest_buf[dest_x], opa);
|
lv_color_24_24_mix(&src_buf[src_x], &dest_buf[dest_x], opa);
|
||||||
@@ -354,8 +377,12 @@ LV_ATTRIBUTE_FAST_MEM static void rgb888_image_blend(_lv_draw_sw_blend_image_dsc
|
|||||||
dest_buf += dest_stride;
|
dest_buf += dest_stride;
|
||||||
src_buf += src_stride;
|
src_buf += src_stride;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
if(mask_buf && opa >= LV_OPA_MAX) {
|
if(mask_buf && opa >= LV_OPA_MAX) {
|
||||||
|
#ifdef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888_WITH_MASK
|
||||||
|
LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888_WITH_MASK(dsc, dest_px_size, src_px_size);
|
||||||
|
#else
|
||||||
uint32_t mask_x;
|
uint32_t mask_x;
|
||||||
for(y = 0; y < h; y++) {
|
for(y = 0; y < h; y++) {
|
||||||
for(mask_x = 0, dest_x = 0, src_x = 0; dest_x < w; mask_x++, dest_x += dest_px_size, src_x += src_px_size) {
|
for(mask_x = 0, dest_x = 0, src_x = 0; dest_x < w; mask_x++, dest_x += dest_px_size, src_x += src_px_size) {
|
||||||
@@ -365,8 +392,12 @@ LV_ATTRIBUTE_FAST_MEM static void rgb888_image_blend(_lv_draw_sw_blend_image_dsc
|
|||||||
src_buf += src_stride;
|
src_buf += src_stride;
|
||||||
mask_buf += mask_stride;
|
mask_buf += mask_stride;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
if(mask_buf && opa < LV_OPA_MAX) {
|
if(mask_buf && opa < LV_OPA_MAX) {
|
||||||
|
#ifdef LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA
|
||||||
|
LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA(dsc, dest_px_size, src_px_size);
|
||||||
|
#else
|
||||||
uint32_t mask_x;
|
uint32_t mask_x;
|
||||||
for(y = 0; y < h; y++) {
|
for(y = 0; y < h; y++) {
|
||||||
for(mask_x = 0, dest_x = 0, src_x = 0; dest_x < w; mask_x++, dest_x += dest_px_size, src_x += src_px_size) {
|
for(mask_x = 0, dest_x = 0, src_x = 0; dest_x < w; mask_x++, dest_x += dest_px_size, src_x += src_px_size) {
|
||||||
@@ -376,6 +407,7 @@ LV_ATTRIBUTE_FAST_MEM static void rgb888_image_blend(_lv_draw_sw_blend_image_dsc
|
|||||||
src_buf += src_stride;
|
src_buf += src_stride;
|
||||||
mask_buf += mask_stride;
|
mask_buf += mask_stride;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -55,7 +55,9 @@
|
|||||||
* Start parsing lv_conf_template.h
|
* Start parsing lv_conf_template.h
|
||||||
-----------------------------------*/
|
-----------------------------------*/
|
||||||
|
|
||||||
|
#ifndef __ASSEMBLY__
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
/*====================
|
/*====================
|
||||||
COLOR SETTINGS
|
COLOR SETTINGS
|
||||||
@@ -2890,15 +2892,19 @@
|
|||||||
* End of parsing lv_conf_template.h
|
* End of parsing lv_conf_template.h
|
||||||
-----------------------------------*/
|
-----------------------------------*/
|
||||||
|
|
||||||
|
#ifndef __ASSEMBLY__
|
||||||
LV_EXPORT_CONST_INT(LV_DPI_DEF);
|
LV_EXPORT_CONST_INT(LV_DPI_DEF);
|
||||||
|
#endif
|
||||||
|
|
||||||
#undef _LV_KCONFIG_PRESENT
|
#undef _LV_KCONFIG_PRESENT
|
||||||
|
|
||||||
|
#ifndef __ASSEMBLY__
|
||||||
#if LV_USE_FLOAT
|
#if LV_USE_FLOAT
|
||||||
typedef float lv_value_precise_t;
|
typedef float lv_value_precise_t;
|
||||||
#else
|
#else
|
||||||
typedef int32_t lv_value_precise_t;
|
typedef int32_t lv_value_precise_t;
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
/*Set some defines if a dependency is disabled*/
|
/*Set some defines if a dependency is disabled*/
|
||||||
#if LV_USE_LOG == 0
|
#if LV_USE_LOG == 0
|
||||||
|
|||||||
@@ -13,7 +13,10 @@ extern "C" {
|
|||||||
/*********************
|
/*********************
|
||||||
* INCLUDES
|
* INCLUDES
|
||||||
*********************/
|
*********************/
|
||||||
|
|
||||||
|
#ifndef __ASSEMBLY__
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
/*********************
|
/*********************
|
||||||
* DEFINES
|
* DEFINES
|
||||||
@@ -55,6 +58,9 @@ extern "C" {
|
|||||||
* TYPEDEFS
|
* TYPEDEFS
|
||||||
**********************/
|
**********************/
|
||||||
|
|
||||||
|
/* Exclude C enum and struct definitions when included by assembly code */
|
||||||
|
#ifndef __ASSEMBLY__
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* LVGL error codes.
|
* LVGL error codes.
|
||||||
*/
|
*/
|
||||||
@@ -88,6 +94,8 @@ typedef int32_t lv_intptr_t;
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif /*__ASSEMBLY__*/
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
* GLOBAL PROTOTYPES
|
* GLOBAL PROTOTYPES
|
||||||
**********************/
|
**********************/
|
||||||
|
|||||||
Reference in New Issue
Block a user