feat(draw-sw): add Helium acceleration to draw-sw (#5045)

Co-authored-by: Gabor Kiss-Vamosi <kisvegabor@gmail.com>
This commit is contained in:
Gabriel Wang
2023-12-27 03:10:16 +00:00
committed by GitHub
parent 1be21a93b3
commit 6fe14490e2
17 changed files with 2342 additions and 859 deletions

View File

@@ -325,7 +325,7 @@ menu "LVGL configuration"
endmenu
menu "GPU"
config LV_USE_GPU_ARM2D
config LV_USE_DRAW_ARM2D
bool "Enable Arm's 2D image processing library (Arm-2D) for all Cortex-M processors."
default n
help

View File

@@ -36,9 +36,10 @@
<repository type="git">https://github.com/lvgl/lvgl.git</repository>
<releases>
<release date="2023-12-12" version="9.0.0-dev1" url="https://raw.githubusercontent.com/lvgl/lvgl/master/env_support/cmsis-pack/LVGL.lvgl.9.0.0-dev1.pack">
<release date="2023-12-24" version="9.0.0-dev2" url="https://raw.githubusercontent.com/lvgl/lvgl/master/env_support/cmsis-pack/LVGL.lvgl.9.0.0-dev2.pack">
- LVGL 9.0.0-dev
- New Driver Architecture
- Adds Helium support
- Other fixes
</release>
<release date="2023-12-05" version="8.3.11" url="https://github.com/lvgl/lvgl/raw/8194d83226c27c84f12dd51e16f5add9939215a5/env_support/cmsis-pack/LVGL.lvgl.8.3.11.pack">
@@ -265,6 +266,12 @@
<require Cclass="LVGL" Cgroup="Essential"/>
</condition>
<condition id="LVGL-Essential-Assets">
<description>Require LVGL Essential Service and Demo Assets </description>
<require Cclass="LVGL" Cgroup="Essential" />
<require Cclass="LVGL" Cgroup="Demos" Csub="Assets" />
</condition>
<condition id="Arm-2D">
<description>Require Arm-2D Support</description>
<require Cclass="Acceleration" Cgroup="Arm-2D"/>
@@ -542,7 +549,7 @@
<!-- src/themes -->
<file category="sourceC" name="src/themes/lv_theme.c" />
<file category="sourceC" name="src/themes/mono/lv_theme_mono.c" />
<file category="sourceC" name="src/themes/basic/lv_theme_basic.c" />
<file category="sourceC" name="src/themes/simple/lv_theme_simple.c" />
<file category="sourceC" name="src/themes/default/lv_theme_default.c" />
<!-- src/tick -->
@@ -562,7 +569,7 @@
<file category="sourceC" name="src/widgets/checkbox/lv_checkbox.c" />
<file category="sourceC" name="src/widgets/dropdown/lv_dropdown.c" />
<file category="sourceC" name="src/widgets/image/lv_image.c" />
<file category="sourceC" name="src/widgets/imgbtn/lv_imgbtn.c" />
<file category="sourceC" name="src/widgets/imagebutton/lv_imagebutton.c" />
<file category="sourceC" name="src/widgets/keyboard/lv_keyboard.c" />
<file category="sourceC" name="src/widgets/label/lv_label.c" />
<file category="sourceC" name="src/widgets/led/lv_led.c" />
@@ -590,6 +597,7 @@
<!-- src/others -->
<file category="sourceC" name="src/others/sysmon/lv_sysmon.c" />
<file category="sourceC" name="src/others/observer/lv_observer.c" />
<!-- src/demons -->
<file category="sourceC" name="demos/lv_demos.c" />
@@ -598,7 +606,7 @@
<file category="sourceC" name="src/osal/lv_os_none.c"/>
<!-- general -->
<file category="preIncludeGlobal" name="lv_conf_cmsis.h" attr="config" version="2.0.2" />
<file category="preIncludeGlobal" name="lv_conf_cmsis.h" attr="config" version="2.1.0" />
<file category="sourceC" name="lv_cmsis_pack.c" />
<file category="header" name="lvgl.h" />
<file category="doc" name="README.md"/>
@@ -1376,21 +1384,6 @@
</component>
<component Cgroup="Libraries and Others" Csub="Observer" condition="LVGL-Essential">
<description>Add an observer pattern implementation</description>
<files>
<!-- src/others/observer -->
<file category="sourceC" name="src/others/observer/lv_observer.c" />
</files>
<RTE_Components_h>
/*! \brief enable an observer pattern implementation*/
#define LV_USE_OBSERVER 1
</RTE_Components_h>
</component>
<component Cgroup="Libraries and Others" Csub="Snapshot" condition="LVGL-Essential">
<description>Add the API to take snapshot for object</description>
<files>
@@ -1406,13 +1399,10 @@
</component>
<component Cgroup="Demos" Csub="Benchmark" condition="LVGL-Essential">
<component Cgroup="Demos" Csub="Assets" condition="LVGL-Essential">
<description>Add the official benchmark.</description>
<files>
<!-- demos/benchmark -->
<file category="sourceC" name="demos/benchmark/lv_demo_benchmark.c" />
<file category="sourceC" name="demos/benchmark/assets/img_benchmark_cogwheel_alpha256.c" />
<file category="sourceC" name="demos/benchmark/assets/img_benchmark_cogwheel_argb.c" />
<file category="sourceC" name="demos/benchmark/assets/img_benchmark_cogwheel_indexed16.c" />
@@ -1421,60 +1411,8 @@
<file category="sourceC" name="demos/benchmark/assets/lv_font_benchmark_montserrat_12_compr_az.c.c" />
<file category="sourceC" name="demos/benchmark/assets/lv_font_benchmark_montserrat_16_compr_az.c.c" />
<file category="sourceC" name="demos/benchmark/assets/lv_font_benchmark_montserrat_28_compr_az.c.c" />
<file category="doc" name="demos/benchmark/README.md" />
</files>
<RTE_Components_h>
/*! \brief enable demo:bencharmk */
#define LV_USE_DEMO_BENCHMARK 1
</RTE_Components_h>
</component>
<component Cgroup="Demos" Csub="Flex Layout" condition="LVGL-Essential">
<description>Add the Flex layout demo</description>
<files>
<!-- demos/flex_layout -->
<file category="sourceC" name="demos/flex_layout/lv_demo_flex_layout_ctrl_pad.c" />
<file category="sourceC" name="demos/flex_layout/lv_demo_flex_layout_flex_loader.c" />
<file category="sourceC" name="demos/flex_layout/lv_demo_flex_layout_main.c" />
<file category="sourceC" name="demos/flex_layout/lv_demo_flex_layout_view.c" />
<file category="sourceC" name="demos/flex_layout/lv_demo_flex_layout_view_child_node.c" />
<file category="sourceC" name="demos/flex_layout/lv_demo_flex_layout_view_ctrl_pad.c" />
</files>
<RTE_Components_h>
/*! \brief enable the Flex layout demo */
#define LV_USE_DEMO_FLEX_LAYOUT 1
</RTE_Components_h>
</component>
<component Cgroup="Demos" Csub="Keypad Encoder" condition="LVGL-Essential">
<description>Add the demonstrate the usage of encoder and keyboard</description>
<files>
<!-- demos/keypad_encoder -->
<file category="sourceC" name="demos/keypad_encoder/lv_demo_keypad_encoder.c" />
<file category="doc" name="demos/keypad_encoder/README.md" />
</files>
<RTE_Components_h>
/*! \brief enable the demonstrate the usage of encoder and keyboard */
#define LV_USE_DEMO_KEYPAD_AND_ENCODER 1
</RTE_Components_h>
</component>
<component Cgroup="Demos" Csub="Multi-Language" condition="LVGL-Essential">
<description>Add the Smart-phone like multi-language demo.</description>
<files>
<!-- demos/multilang -->
<file category="sourceC" name="demos/multilang/lv_demo_multilang.c" />
<file category="sourceC" name="demos/multilang/assets/img_multilang_like.c" />
<file category="sourceC" name="demos/multilang/assets/avatars/img_multilang_avatar_1.c" />
<file category="sourceC" name="demos/multilang/assets/avatars/img_multilang_avatar_2.c" />
@@ -1516,26 +1454,8 @@
<file category="sourceC" name="demos/multilang/assets/fonts/font_multilang_large.c" />
<file category="sourceC" name="demos/multilang/assets/fonts/font_multilang_small.c" />
<file category="doc" name="demos/multilang/README.md" />
</files>
<RTE_Components_h>
/*! \brief enable the Smart-phone like multi-language demo */
#define LV_USE_DEMO_MULTILANG 1
</RTE_Components_h>
</component>
<component Cgroup="Demos" Csub="Music Player" condition="LVGL-Essential">
<description>Add the music player demo</description>
<files>
<!-- demos/music -->
<file category="sourceC" name="demos/music/lv_demo_music.c" />
<file category="sourceC" name="demos/music/lv_demo_music_list.c" />
<file category="sourceC" name="demos/music/lv_demo_music_main.c" />
<file category="sourceC" name="demos/music/assets/img_lv_demo_music_wave_top_large.c" />
<file category="sourceC" name="demos/music/assets/img_lv_demo_music_wave_top.c" />
<file category="sourceC" name="demos/music/assets/img_lv_demo_music_wave_bottom_large.c" />
@@ -1580,7 +1500,105 @@
<file category="sourceC" name="demos/music/assets/img_lv_demo_music_btn_list_pause_large.c" />
<file category="sourceC" name="demos/music/assets/img_lv_demo_music_btn_list_pause.c" />
<file category="sourceC" name="demos/music/assets/img_lv_demo_music_btn_corner_large.c" />
<!-- demos/widgets -->
<file category="sourceC" name="demos/widgets/assets/img_clothes.c" />
<file category="sourceC" name="demos/widgets/assets/img_demo_widgets_avatar.c" />
<file category="sourceC" name="demos/widgets/assets/img_demo_widgets_needle.c" />
<file category="sourceC" name="demos/widgets/assets/img_lvgl_logo.c" />
<!-- demos/transform -->
<file category="sourceC" name="demos/transform/assets/img_transform_avatar_15.c" />
<!-- demos/vector_graphic -->
<file category="sourceC" name="demos/vector_graphic/assets/img_demo_vector_avatar.c" />
<!-- demos/render -->
<file category="sourceC" name="demos/render/assets/img_render_arc_bg.c" />
<file category="sourceC" name="demos/render/assets/img_render_lvgl_logo_argb8888.c" />
<file category="sourceC" name="demos/render/assets/img_render_lvgl_logo_rgb565.c" />
<file category="sourceC" name="demos/render/assets/img_render_lvgl_logo_rgb888.c" />
<file category="sourceC" name="demos/render/assets/img_render_lvgl_logo_xrgb8888.c" />
</files>
</component>
<component Cgroup="Demos" Csub="Benchmark" condition="LVGL-Essential-Assets">
<description>Add the official benchmark.</description>
<files>
<!-- demos/benchmark -->
<file category="sourceC" name="demos/benchmark/lv_demo_benchmark.c" />
<file category="doc" name="demos/benchmark/README.md" />
</files>
<RTE_Components_h>
/*! \brief enable demo:bencharmk */
#define LV_USE_DEMO_BENCHMARK 1
</RTE_Components_h>
</component>
<component Cgroup="Demos" Csub="Flex Layout" condition="LVGL-Essential-Assets">
<description>Add the Flex layout demo</description>
<files>
<!-- demos/flex_layout -->
<file category="sourceC" name="demos/flex_layout/lv_demo_flex_layout_ctrl_pad.c" />
<file category="sourceC" name="demos/flex_layout/lv_demo_flex_layout_flex_loader.c" />
<file category="sourceC" name="demos/flex_layout/lv_demo_flex_layout_main.c" />
<file category="sourceC" name="demos/flex_layout/lv_demo_flex_layout_view.c" />
<file category="sourceC" name="demos/flex_layout/lv_demo_flex_layout_view_child_node.c" />
<file category="sourceC" name="demos/flex_layout/lv_demo_flex_layout_view_ctrl_pad.c" />
</files>
<RTE_Components_h>
/*! \brief enable the Flex layout demo */
#define LV_USE_DEMO_FLEX_LAYOUT 1
</RTE_Components_h>
</component>
<component Cgroup="Demos" Csub="Keypad Encoder" condition="LVGL-Essential-Assets">
<description>Add the demonstrate the usage of encoder and keyboard</description>
<files>
<!-- demos/keypad_encoder -->
<file category="sourceC" name="demos/keypad_encoder/lv_demo_keypad_encoder.c" />
<file category="doc" name="demos/keypad_encoder/README.md" />
</files>
<RTE_Components_h>
/*! \brief enable the demonstrate the usage of encoder and keyboard */
#define LV_USE_DEMO_KEYPAD_AND_ENCODER 1
</RTE_Components_h>
</component>
<component Cgroup="Demos" Csub="Multi-Language" condition="LVGL-Essential-Assets">
<description>Add the Smart-phone like multi-language demo.</description>
<files>
<!-- demos/multilang -->
<file category="sourceC" name="demos/multilang/lv_demo_multilang.c" />
<file category="doc" name="demos/multilang/README.md" />
</files>
<RTE_Components_h>
/*! \brief enable the Smart-phone like multi-language demo */
#define LV_USE_DEMO_MULTILANG 1
</RTE_Components_h>
</component>
<component Cgroup="Demos" Csub="Music Player" condition="LVGL-Essential-Assets">
<description>Add the music player demo</description>
<files>
<!-- demos/music -->
<file category="sourceC" name="demos/music/lv_demo_music.c" />
<file category="sourceC" name="demos/music/lv_demo_music_list.c" />
<file category="sourceC" name="demos/music/lv_demo_music_main.c" />
<file category="doc" name="demos/music/README.md" />
</files>
@@ -1592,7 +1610,7 @@
</component>
<component Cgroup="Demos" Csub="Scroll" condition="LVGL-Essential">
<component Cgroup="Demos" Csub="Scroll" condition="LVGL-Essential-Assets">
<description>Add the demonstration for scroll settings</description>
<files>
<!-- demos/scroll -->
@@ -1607,7 +1625,7 @@
</component>
<component Cgroup="Demos" Csub="Stress Test" condition="LVGL-Essential">
<component Cgroup="Demos" Csub="Stress Test" condition="LVGL-Essential-Assets">
<description>Add the Stress test for LVGL</description>
<files>
<!-- demos/stress -->
@@ -1622,12 +1640,11 @@
</component>
<component Cgroup="Demos" Csub="Widget Transform" condition="LVGL-Essential">
<component Cgroup="Demos" Csub="Widget Transform" condition="LVGL-Essential-Assets">
<description>Add the Widget transformation demo</description>
<files>
<!-- demos/transform -->
<file category="sourceC" name="demos/transform/lv_demo_transform.c" />
<file category="sourceC" name="demos/transform/assets/img_transform_avatar_15.c" />
</files>
<RTE_Components_h>
@@ -1638,12 +1655,11 @@
</component>
<component Cgroup="Demos" Csub="Vector Graphic" condition="LVGL-Essential">
<component Cgroup="Demos" Csub="Vector Graphic" condition="LVGL-Essential-Assets">
<description>Add the Vector graphic demo</description>
<files>
<!-- demos/vector_graphic -->
<file category="sourceC" name="demos/vector_graphic/lv_demo_vector_graphic.c" />
<file category="sourceC" name="demos/vector_graphic/assets/img_demo_vector_avatar.c" />
</files>
<RTE_Components_h>
@@ -1654,16 +1670,11 @@
</component>
<component Cgroup="Demos" Csub="Widgets" condition="LVGL-Essential">
<component Cgroup="Demos" Csub="Widgets" condition="LVGL-Essential-Assets">
<description>Add the demo:widgets</description>
<files>
<!-- demos/widgets -->
<file category="sourceC" name="demos/widgets/lv_demo_widgets.c" />
<file category="sourceC" name="demos/widgets/assets/img_clothes.c" />
<file category="sourceC" name="demos/widgets/assets/img_demo_widgets_avatar.c" />
<file category="sourceC" name="demos/widgets/assets/img_demo_widgets_needle.c" />
<file category="sourceC" name="demos/widgets/assets/img_lvgl_logo.c" />
</files>
<RTE_Components_h>
@@ -1674,18 +1685,11 @@
</component>
<component Cgroup="Demos" Csub="Render Test" condition="LVGL-Essential">
<component Cgroup="Demos" Csub="Render Test" condition="LVGL-Essential-Assets">
<description>Add the Render test for each primitives. Requires at least 480x272 display</description>
<files>
<!-- demos/render -->
<file category="sourceC" name="demos/render/lv_demo_render.c" />
<file category="sourceC" name="demos/render/assets/img_render_arc_bg.c" />
<file category="sourceC" name="demos/render/assets/img_render_lvgl_logo_argb8888.c" />
<file category="sourceC" name="demos/render/assets/img_render_lvgl_logo_rgb565.c" />
<file category="sourceC" name="demos/render/assets/img_render_lvgl_logo_rgb888.c" />
<file category="sourceC" name="demos/render/assets/img_render_lvgl_logo_xrgb8888.c" />
<file category="doc" name="demos/render/README.md" />
</files>

View File

@@ -2,8 +2,8 @@
<index schemaVersion="1.0.0" xs:noNamespaceSchemaLocation="PackIndex.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance">
<vendor>LVGL</vendor>
<url>https://raw.githubusercontent.com/lvgl/lvgl/master/env_support/cmsis-pack/</url>
<timestamp>2023-12-12</timestamp>
<timestamp>2023-12-24</timestamp>
<pindex>
<pdsc url="https://raw.githubusercontent.com/lvgl/lvgl/master/env_support/cmsis-pack/" vendor="LVGL" name="lvgl" version="9.0.0-dev1"/>
<pdsc url="https://raw.githubusercontent.com/lvgl/lvgl/master/env_support/cmsis-pack/" vendor="LVGL" name="lvgl" version="9.0.0-dev2"/>
</pindex>
</index>

View File

@@ -40,39 +40,66 @@ remove the misleading guide above this code segment.
4. Remove macro definitions for
- LV_USE_DEMO_WIDGETS
- LV_USE_DEMO_BENCHMARK
- LV_USE_IME_PINYIN
- LV_USE_OS
- LV_USE_FILE_EXPLORER
- LV_USE_DEMO_WIDGETS
- LV_USE_DEMO_KEYPAD_AND_ENCODER
- LV_USE_DEMO_BENCHMARK
- LV_USE_DEMO_RENDER
- LV_USE_DEMO_STRESS
- LV_USE_DEMO_MUSIC
- LV_USE_DEMO_FLEX_LAYOUT
- LV_USE_DEMO_MULTILANG
- LV_USE_DEMO_TRANSFORM
- LV_USE_DEMO_SCROLL
- LV_USE_DEMO_VECTOR_GRAPHIC
- LV_USE_DRAW_VGLITE
- LV_USE_DRAW_PXP
- LV_USE_DRAW_SDL
- LV_USE_DRAW_ARM2D
- LV_USE_SNAPSHOT
- LV_USE_MONKEY
- LV_USE_GRIDNAV
- LV_USE_FRAGMENT
- LV_USE_IMGFONT
- LV_USE_OBSERVER
5. Update `LV_LOG_PRINTF` to `1` and `LV_LOG_LEVEL` to `LV_LOG_LEVEL_USER`
6. Set `LV_FONT_MONTSERRAT_12` and `LV_FONT_MONTSERRAT_16` to `1` (So Widgets and Benchmark can be compiled correctly, this is for improving the out of box experience.)
6. Set `LV_FONT_MONTSERRAT_12`, `LV_FONT_MONTSERRAT_24` and `LV_FONT_MONTSERRAT_16` to `1` (So Widgets and Benchmark can be compiled correctly, this is for improving the out of box experience.)
7. Update macro `LV_ATTRIBUTE_MEM_ALIGN` and `LV_ATTRIBUTE_MEM_ALIGN_SIZE` to force a WORD alignment.
```c
#define LV_ATTRIBUTE_MEM_ALIGN_SIZE 4
#define LV_ATTRIBUTE_MEM_ALIGN_SIZE 1
#define LV_DRAW_BUF_STRIDE_ALIGN 4
#define LV_ATTRIBUTE_MEM_ALIGN __attribute__((aligned(4)))
```
@@ -130,7 +157,47 @@ Make sure `LV_MEM_SIZE` is no less than `(256*1024U)`.
```
11. rename '**lv_conf_template.h**' to '**lv_conf_cmsis.h**'.
11. Add the following code to `HAL SETTINGS`:
```c
/*customize tick-get */
#if defined(__PERF_COUNTER__) && __PERF_COUNTER__
#define LV_GLOBAL_INIT(__GLOBAL_PTR) \
do { \
lv_global_init((lv_global_t *)(__GLOBAL_PTR)); \
extern uint32_t perfc_tick_get(void); \
(__GLOBAL_PTR)->tick_state.tick_get_cb = perfc_tick_get; \
} while(0)
#endif
```
12. Replace the macro definition:
```c
#define LV_USE_DRAW_SW_ASM LV_DRAW_SW_ASM_NONE
```
with:
```c
#if !defined(LV_USE_DRAW_SW_ASM) && defined(RTE_Acceleration_Arm_2D)
/*turn-on helium acceleration when Arm-2D and the Helium-powered device are detected */
#if defined(__ARM_FEATURE_MVE) && __ARM_FEATURE_MVE
#define LV_USE_DRAW_SW_ASM LV_DRAW_SW_ASM_HELIUM
#define LV_USE_DRAW_ARM2D 1
#endif
#endif
#ifndef LV_USE_DRAW_SW_ASM
#define LV_USE_DRAW_SW_ASM LV_DRAW_SW_ASM_NONE
#endif
```
13. rename '**lv_conf_template.h**' to '**lv_conf_cmsis.h**'.

View File

@@ -126,14 +126,8 @@ _ARMABI time_t time(time_t * time)
* Get the elapsed milliseconds since start up from perf_counter
* @return the elapsed milliseconds
*/
uint32_t $Sub$$lv_tick_get(void)
uint32_t perfc_tick_get(void)
{
lv_tick_state_t * state_p = &state;
if (state_p->tick_get_cb){
return state_p->tick_get_cb();
}
return (uint32_t)get_system_ms();
}

View File

@@ -61,12 +61,22 @@
*(Not so important, you can adjust it to modify default sizes and spaces)*/
#define LV_DPI_DEF 130 /*[px/inch]*/
/*customize tick-get */
#if defined(__PERF_COUNTER__) && __PERF_COUNTER__
#define LV_GLOBAL_INIT(__GLOBAL_PTR) \
do { \
lv_global_init((lv_global_t *)(__GLOBAL_PTR)); \
extern uint32_t perfc_tick_get(void); \
(__GLOBAL_PTR)->tick_state.tick_get_cb = perfc_tick_get; \
} while(0)
#endif
/*========================
* RENDERING CONFIGURATION
*========================*/
/*Align the stride of all layers and images to this bytes*/
#define LV_DRAW_BUF_STRIDE_ALIGN 4
#define LV_DRAW_BUF_STRIDE_ALIGN 1
/*Align the start address of draw_buf addresses to this bytes*/
#define LV_DRAW_BUF_ALIGN 4
@@ -103,7 +113,17 @@
#define LV_DRAW_SW_CIRCLE_CACHE_SIZE 4
#endif
#define LV_USE_DRAW_SW_ASM LV_DRAW_SW_ASM_NONE
#if !defined(LV_USE_DRAW_SW_ASM) && defined(RTE_Acceleration_Arm_2D)
/*turn-on helium acceleration when Arm-2D and the Helium-powered device are detected */
#if defined(__ARM_FEATURE_MVE) && __ARM_FEATURE_MVE
#define LV_USE_DRAW_SW_ASM LV_DRAW_SW_ASM_HELIUM
#define LV_USE_DRAW_ARM2D 1
#endif
#endif
#ifndef LV_USE_DRAW_SW_ASM
#define LV_USE_DRAW_SW_ASM LV_DRAW_SW_ASM_NONE
#endif
#if LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_CUSTOM
#define LV_DRAW_SW_ASM_CUSTOM_INCLUDE ""
@@ -680,6 +700,8 @@
#define LV_IMGFONT_USE_IMAGE_CACHE_HEADER 0
#endif
/*1: Enable an observer pattern implementation*/
#define LV_USE_OBSERVER 1
/*1: Enable Pinyin input method*/
/*Requires: lv_keyboard*/

View File

@@ -116,6 +116,9 @@
#endif
#endif
/* Use Arm-2D on Cortex-M based devices. Please only enable it for Helium Powered devices for now */
#define LV_USE_DRAW_ARM2D 0
/* Use NXP's VG-Lite GPU on iMX RTxxx platforms. */
#define LV_USE_DRAW_VGLITE 0

View File

@@ -47,7 +47,7 @@ fout.write(
#define LV_DRAW_SW_ASM_NONE 0
#define LV_DRAW_SW_ASM_NEON 1
#define LV_DRAW_SW_ASM_MVE 2
#define LV_DRAW_SW_ASM_HELIUM 2
#define LV_DRAW_SW_ASM_CUSTOM 255
/* Handle special Kconfig options */

File diff suppressed because it is too large Load Diff

View File

@@ -18,6 +18,8 @@
#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_HELIUM
#include "helium/lv_blend_helium.h"
#elif LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_CUSTOM
#include LV_DRAW_SW_ASM_CUSTOM_INCLUDE
#endif
@@ -65,6 +67,25 @@ LV_ATTRIBUTE_FAST_MEM static inline void * drawbuf_next_row(const void * buf, ui
* MACROS
**********************/
#if LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_NONE
#define LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888(...) LV_RESULT_INVALID
#define LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888_WITH_OPA(...) LV_RESULT_INVALID
#define LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888_WITH_MASK(...) LV_RESULT_INVALID
#define LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888_MIX_MASK_OPA(...) LV_RESULT_INVALID
#define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888(...) LV_RESULT_INVALID
#define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888_WITH_OPA(...) LV_RESULT_INVALID
#define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888_WITH_MASK(...) LV_RESULT_INVALID
#define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA(...) LV_RESULT_INVALID
#define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888(...) LV_RESULT_INVALID
#define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888_WITH_OPA(...) LV_RESULT_INVALID
#define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888_WITH_MASK(...) LV_RESULT_INVALID
#define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA(...) LV_RESULT_INVALID
#define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888(...) LV_RESULT_INVALID
#define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888_WITH_OPA(...) LV_RESULT_INVALID
#define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888_WITH_MASK(...) LV_RESULT_INVALID
#define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA(...) LV_RESULT_INVALID
#endif
/**********************
* GLOBAL FUNCTIONS
**********************/
@@ -95,91 +116,86 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_sw_blend_color_to_argb8888(_lv_draw_sw_blend_
/*Simple fill*/
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 * dest_buf = dsc->dest_buf;
for(y = 0; y < h; y++) {
for(x = 0; x < w - 16; x += 16) {
dest_buf[x + 0] = color32;
dest_buf[x + 1] = color32;
dest_buf[x + 2] = color32;
dest_buf[x + 3] = color32;
if(LV_RESULT_INVALID == LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888(dsc)) {
uint32_t color32 = lv_color_to_u32(dsc->color);
uint32_t * dest_buf = dsc->dest_buf;
for(y = 0; y < h; y++) {
for(x = 0; x < w - 16; x += 16) {
dest_buf[x + 0] = color32;
dest_buf[x + 1] = color32;
dest_buf[x + 2] = color32;
dest_buf[x + 3] = color32;
dest_buf[x + 4] = color32;
dest_buf[x + 5] = color32;
dest_buf[x + 6] = color32;
dest_buf[x + 7] = color32;
dest_buf[x + 4] = color32;
dest_buf[x + 5] = color32;
dest_buf[x + 6] = color32;
dest_buf[x + 7] = color32;
dest_buf[x + 8] = color32;
dest_buf[x + 9] = color32;
dest_buf[x + 10] = color32;
dest_buf[x + 11] = color32;
dest_buf[x + 8] = color32;
dest_buf[x + 9] = color32;
dest_buf[x + 10] = color32;
dest_buf[x + 11] = color32;
dest_buf[x + 12] = color32;
dest_buf[x + 13] = color32;
dest_buf[x + 14] = color32;
dest_buf[x + 15] = color32;
dest_buf[x + 12] = color32;
dest_buf[x + 13] = color32;
dest_buf[x + 14] = color32;
dest_buf[x + 15] = color32;
}
for(; x < w; x ++) {
dest_buf[x] = color32;
}
dest_buf = drawbuf_next_row(dest_buf, dest_stride);
}
for(; x < w; x ++) {
dest_buf[x] = color32;
}
dest_buf = drawbuf_next_row(dest_buf, dest_stride);
}
#endif
}
/*Opacity only*/
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 * dest_buf = dsc->dest_buf;
if(LV_RESULT_INVALID == LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888_WITH_OPA(dsc)) {
lv_color32_t color_argb = lv_color_to_32(dsc->color, opa);
lv_color32_t * dest_buf = dsc->dest_buf;
for(y = 0; y < h; y++) {
for(x = 0; x < w; x++) {
dest_buf[x] = lv_color_32_32_mix(color_argb, dest_buf[x], &cache);
for(y = 0; y < h; y++) {
for(x = 0; x < w; x++) {
dest_buf[x] = lv_color_32_32_mix(color_argb, dest_buf[x], &cache);
}
dest_buf = drawbuf_next_row(dest_buf, dest_stride);
}
dest_buf = drawbuf_next_row(dest_buf, dest_stride);
}
#endif
}
/*Masked with full opacity*/
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 * dest_buf = dsc->dest_buf;
for(y = 0; y < h; y++) {
for(x = 0; x < w; x++) {
color_argb.alpha = mask[x];
dest_buf[x] = lv_color_32_32_mix(color_argb, dest_buf[x], &cache);
}
if(LV_RESULT_INVALID == LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888_WITH_MASK(dsc)) {
lv_color32_t color_argb = lv_color_to_32(dsc->color, 0xff);
lv_color32_t * dest_buf = dsc->dest_buf;
for(y = 0; y < h; y++) {
for(x = 0; x < w; x++) {
color_argb.alpha = mask[x];
dest_buf[x] = lv_color_32_32_mix(color_argb, dest_buf[x], &cache);
}
dest_buf = drawbuf_next_row(dest_buf, dest_stride);
mask += mask_stride;
dest_buf = drawbuf_next_row(dest_buf, dest_stride);
mask += mask_stride;
}
}
#endif
}
/*Masked with opacity*/
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 * dest_buf = dsc->dest_buf;
for(y = 0; y < h; y++) {
for(x = 0; x < w; x++) {
color_argb.alpha = LV_OPA_MIX2(mask[x], opa);
dest_buf[x] = lv_color_32_32_mix(color_argb, dest_buf[x], &cache);
if(LV_RESULT_INVALID == LV_DRAW_SW_COLOR_BLEND_TO_ARGB8888_MIX_MASK_OPA(dsc)) {
lv_color32_t color_argb = lv_color_to_32(dsc->color, opa);
lv_color32_t * dest_buf = dsc->dest_buf;
for(y = 0; y < h; y++) {
for(x = 0; x < w; x++) {
color_argb.alpha = LV_OPA_MIX2(mask[x], opa);
dest_buf[x] = lv_color_32_32_mix(color_argb, dest_buf[x], &cache);
}
dest_buf = drawbuf_next_row(dest_buf, dest_stride);
mask += mask_stride;
}
dest_buf = drawbuf_next_row(dest_buf, dest_stride);
mask += mask_stride;
}
#endif
}
}
@@ -231,62 +247,58 @@ LV_ATTRIBUTE_FAST_MEM static void rgb565_image_blend(_lv_draw_sw_blend_image_dsc
if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) {
if(mask_buf == NULL) {
#ifdef LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888
lv_result_t accelerated;
if(opa >= LV_OPA_MAX) {
LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888(dsc);
accelerated = LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888(dsc);
}
else {
LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888_WITH_OPA(dsc);
accelerated = LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888_WITH_OPA(dsc);
}
#else
color_argb.alpha = opa;
for(y = 0; y < h; y++) {
for(x = 0; x < w; x++) {
color_argb.red = (src_buf_c16[x].red * 2106) >> 8; /*To make it rounded*/
color_argb.green = (src_buf_c16[x].green * 1037) >> 8;
color_argb.blue = (src_buf_c16[x].blue * 2106) >> 8;
dest_buf_c32[x] = lv_color_32_32_mix(color_argb, dest_buf_c32[x], &cache);
if(LV_RESULT_INVALID == accelerated) {
color_argb.alpha = opa;
for(y = 0; y < h; y++) {
for(x = 0; x < w; x++) {
color_argb.red = (src_buf_c16[x].red * 2106) >> 8; /*To make it rounded*/
color_argb.green = (src_buf_c16[x].green * 1037) >> 8;
color_argb.blue = (src_buf_c16[x].blue * 2106) >> 8;
dest_buf_c32[x] = lv_color_32_32_mix(color_argb, dest_buf_c32[x], &cache);
}
dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride);
src_buf_c16 = drawbuf_next_row(src_buf_c16, src_stride);
}
dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride);
src_buf_c16 = drawbuf_next_row(src_buf_c16, src_stride);
}
#endif
}
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(x = 0; x < w; x++) {
color_argb.alpha = mask_buf[x];
color_argb.red = (src_buf_c16[x].red * 2106) >> 8; /*To make it rounded*/
color_argb.green = (src_buf_c16[x].green * 1037) >> 8;
color_argb.blue = (src_buf_c16[x].blue * 2106) >> 8;
dest_buf_c32[x] = lv_color_32_32_mix(color_argb, dest_buf_c32[x], &cache);
if(LV_RESULT_INVALID == LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888_WITH_MASK(dsc)) {
for(y = 0; y < h; y++) {
for(x = 0; x < w; x++) {
color_argb.alpha = mask_buf[x];
color_argb.red = (src_buf_c16[x].red * 2106) >> 8; /*To make it rounded*/
color_argb.green = (src_buf_c16[x].green * 1037) >> 8;
color_argb.blue = (src_buf_c16[x].blue * 2106) >> 8;
dest_buf_c32[x] = lv_color_32_32_mix(color_argb, dest_buf_c32[x], &cache);
}
dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride);
src_buf_c16 = drawbuf_next_row(src_buf_c16, src_stride);
mask_buf += mask_stride;
}
dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride);
src_buf_c16 = drawbuf_next_row(src_buf_c16, src_stride);
mask_buf += mask_stride;
}
#endif
}
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(x = 0; x < w; x++) {
color_argb.alpha = LV_OPA_MIX2(mask_buf[x], opa);
color_argb.red = (src_buf_c16[x].red * 2106) >> 8; /*To make it rounded*/
color_argb.green = (src_buf_c16[x].green * 1037) >> 8;
color_argb.blue = (src_buf_c16[x].blue * 2106) >> 8;
dest_buf_c32[x] = lv_color_32_32_mix(color_argb, dest_buf_c32[x], &cache);
if(LV_RESULT_INVALID == LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA(dsc)) {
for(y = 0; y < h; y++) {
for(x = 0; x < w; x++) {
color_argb.alpha = LV_OPA_MIX2(mask_buf[x], opa);
color_argb.red = (src_buf_c16[x].red * 2106) >> 8; /*To make it rounded*/
color_argb.green = (src_buf_c16[x].green * 1037) >> 8;
color_argb.blue = (src_buf_c16[x].blue * 2106) >> 8;
dest_buf_c32[x] = lv_color_32_32_mix(color_argb, dest_buf_c32[x], &cache);
}
dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride);
src_buf_c16 = drawbuf_next_row(src_buf_c16, src_stride);
mask_buf += mask_stride;
}
dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride);
src_buf_c16 = drawbuf_next_row(src_buf_c16, src_stride);
mask_buf += mask_stride;
}
#endif
}
}
else {
@@ -333,83 +345,77 @@ LV_ATTRIBUTE_FAST_MEM static void rgb888_image_blend(_lv_draw_sw_blend_image_dsc
if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) {
/*Special case*/
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) {
uint32_t line_in_bytes = w * 4;
for(y = 0; y < h; y++) {
lv_memcpy(dest_buf_c32, src_buf, line_in_bytes);
dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride);
src_buf = drawbuf_next_row(src_buf, src_stride);
if(LV_RESULT_INVALID == LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888(dsc, src_px_size)) {
if(src_px_size == 4) {
uint32_t line_in_bytes = w * 4;
for(y = 0; y < h; y++) {
lv_memcpy(dest_buf_c32, src_buf, line_in_bytes);
dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride);
src_buf = drawbuf_next_row(src_buf, src_stride);
}
}
else if(src_px_size == 3) {
for(y = 0; y < h; y++) {
for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x += 3) {
dest_buf_c32[dest_x].red = src_buf[src_x + 2];
dest_buf_c32[dest_x].green = src_buf[src_x + 1];
dest_buf_c32[dest_x].blue = src_buf[src_x + 0];
dest_buf_c32[dest_x].alpha = 0xff;
}
dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride);
src_buf = drawbuf_next_row(src_buf, src_stride);
}
}
}
else if(src_px_size == 3) {
}
if(mask_buf == NULL && opa < LV_OPA_MAX) {
if(LV_RESULT_INVALID == LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888_WITH_OPA(dsc, src_px_size)) {
color_argb.alpha = opa;
for(y = 0; y < h; y++) {
for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x += 3) {
dest_buf_c32[dest_x].red = src_buf[src_x + 2];
dest_buf_c32[dest_x].green = src_buf[src_x + 1];
dest_buf_c32[dest_x].blue = src_buf[src_x + 0];
dest_buf_c32[dest_x].alpha = 0xff;
for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x += src_px_size) {
color_argb.red = src_buf[src_x + 2];
color_argb.green = src_buf[src_x + 1];
color_argb.blue = src_buf[src_x + 0];
dest_buf_c32[dest_x] = lv_color_32_32_mix(color_argb, dest_buf_c32[dest_x], &cache);
}
dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride);
src_buf = drawbuf_next_row(src_buf, src_stride);
}
}
#endif
}
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;
for(y = 0; y < h; y++) {
for(dest_x = 0, src_x = 0; dest_x < w; dest_x++, src_x += src_px_size) {
color_argb.red = src_buf[src_x + 2];
color_argb.green = src_buf[src_x + 1];
color_argb.blue = src_buf[src_x + 0];
dest_buf_c32[dest_x] = lv_color_32_32_mix(color_argb, dest_buf_c32[dest_x], &cache);
}
dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride);
src_buf = drawbuf_next_row(src_buf, src_stride);
}
#endif
}
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(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.red = src_buf[src_x + 2];
color_argb.green = src_buf[src_x + 1];
color_argb.blue = src_buf[src_x + 0];
dest_buf_c32[dest_x] = lv_color_32_32_mix(color_argb, dest_buf_c32[dest_x], &cache);
if(LV_RESULT_INVALID == LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888_WITH_MASK(dsc, src_px_size)) {
for(y = 0; y < h; y++) {
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.red = src_buf[src_x + 2];
color_argb.green = src_buf[src_x + 1];
color_argb.blue = src_buf[src_x + 0];
dest_buf_c32[dest_x] = lv_color_32_32_mix(color_argb, dest_buf_c32[dest_x], &cache);
}
dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride);
src_buf = drawbuf_next_row(src_buf, src_stride);
mask_buf += mask_stride;
}
dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride);
src_buf = drawbuf_next_row(src_buf, src_stride);
mask_buf += mask_stride;
}
#endif
}
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(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.red = src_buf[src_x + 2];
color_argb.green = src_buf[src_x + 1];
color_argb.blue = src_buf[src_x + 0];
dest_buf_c32[dest_x] = lv_color_32_32_mix(color_argb, dest_buf_c32[dest_x], &cache);
if(LV_RESULT_INVALID == LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA(dsc, src_px_size)) {
for(y = 0; y < h; y++) {
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.red = src_buf[src_x + 2];
color_argb.green = src_buf[src_x + 1];
color_argb.blue = src_buf[src_x + 0];
dest_buf_c32[dest_x] = lv_color_32_32_mix(color_argb, dest_buf_c32[dest_x], &cache);
}
dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride);
src_buf = drawbuf_next_row(src_buf, src_stride);
mask_buf += mask_stride;
}
dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride);
src_buf = drawbuf_next_row(src_buf, src_stride);
mask_buf += mask_stride;
}
#endif
}
}
else {
@@ -452,64 +458,56 @@ LV_ATTRIBUTE_FAST_MEM static void argb8888_image_blend(_lv_draw_sw_blend_image_d
if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) {
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(x = 0; x < w; x++) {
dest_buf_c32[x] = lv_color_32_32_mix(src_buf_c32[x], dest_buf_c32[x], &cache);
if(LV_RESULT_INVALID == LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888(dsc)) {
for(y = 0; y < h; y++) {
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 = drawbuf_next_row(dest_buf_c32, dest_stride);
src_buf_c32 = drawbuf_next_row(src_buf_c32, src_stride);
}
dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride);
src_buf_c32 = drawbuf_next_row(src_buf_c32, src_stride);
}
#endif
}
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(x = 0; x < w; x++) {
color_argb = src_buf_c32[x];
color_argb.alpha = LV_OPA_MIX2(color_argb.alpha, opa);
dest_buf_c32[x] = lv_color_32_32_mix(color_argb, dest_buf_c32[x], &cache);
if(LV_RESULT_INVALID == LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888_WITH_OPA(dsc)) {
for(y = 0; y < h; y++) {
for(x = 0; x < w; x++) {
color_argb = src_buf_c32[x];
color_argb.alpha = LV_OPA_MIX2(color_argb.alpha, opa);
dest_buf_c32[x] = lv_color_32_32_mix(color_argb, dest_buf_c32[x], &cache);
}
dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride);
src_buf_c32 = drawbuf_next_row(src_buf_c32, src_stride);
}
dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride);
src_buf_c32 = drawbuf_next_row(src_buf_c32, src_stride);
}
#endif
}
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(x = 0; x < w; x++) {
color_argb = src_buf_c32[x];
color_argb.alpha = LV_OPA_MIX2(color_argb.alpha, mask_buf[x]);
dest_buf_c32[x] = lv_color_32_32_mix(color_argb, dest_buf_c32[x], &cache);
if(LV_RESULT_INVALID == LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888_WITH_MASK(dsc)) {
for(y = 0; y < h; y++) {
for(x = 0; x < w; x++) {
color_argb = src_buf_c32[x];
color_argb.alpha = LV_OPA_MIX2(color_argb.alpha, mask_buf[x]);
dest_buf_c32[x] = lv_color_32_32_mix(color_argb, dest_buf_c32[x], &cache);
}
dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride);
src_buf_c32 = drawbuf_next_row(src_buf_c32, src_stride);
mask_buf += mask_stride;
}
dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride);
src_buf_c32 = drawbuf_next_row(src_buf_c32, src_stride);
mask_buf += mask_stride;
}
#endif
}
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(x = 0; x < w; x++) {
color_argb = src_buf_c32[x];
color_argb.alpha = LV_OPA_MIX3(color_argb.alpha, opa, mask_buf[x]);
dest_buf_c32[x] = lv_color_32_32_mix(color_argb, dest_buf_c32[x], &cache);
if(LV_RESULT_INVALID == LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_ARGB8888_MIX_MASK_OPA(dsc)) {
for(y = 0; y < h; y++) {
for(x = 0; x < w; x++) {
color_argb = src_buf_c32[x];
color_argb.alpha = LV_OPA_MIX3(color_argb.alpha, opa, mask_buf[x]);
dest_buf_c32[x] = lv_color_32_32_mix(color_argb, dest_buf_c32[x], &cache);
}
dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride);
src_buf_c32 = drawbuf_next_row(src_buf_c32, src_stride);
mask_buf += mask_stride;
}
dest_buf_c32 = drawbuf_next_row(dest_buf_c32, dest_stride);
src_buf_c32 = drawbuf_next_row(src_buf_c32, src_stride);
mask_buf += mask_stride;
}
#endif
}
}
else {

View File

@@ -18,6 +18,8 @@
#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_HELIUM
#include "helium/lv_blend_helium.h"
#elif LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_CUSTOM
#include LV_DRAW_SW_ASM_CUSTOM_INCLUDE
#endif
@@ -52,6 +54,25 @@ LV_ATTRIBUTE_FAST_MEM static inline void * drawbuf_next_row(const void * buf, ui
* MACROS
**********************/
#if LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_NONE
#define LV_DRAW_SW_COLOR_BLEND_TO_RGB565(...) LV_RESULT_INVALID
#define LV_DRAW_SW_COLOR_BLEND_TO_RGB565_WITH_OPA(...) LV_RESULT_INVALID
#define LV_DRAW_SW_COLOR_BLEND_TO_RGB565_WITH_MASK(...) LV_RESULT_INVALID
#define LV_DRAW_SW_COLOR_BLEND_TO_RGB565_MIX_MASK_OPA(...) LV_RESULT_INVALID
#define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565(...) LV_RESULT_INVALID
#define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565_WITH_OPA(...) LV_RESULT_INVALID
#define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565_WITH_MASK(...) LV_RESULT_INVALID
#define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA(...) LV_RESULT_INVALID
#define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565(...) LV_RESULT_INVALID
#define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565_WITH_OPA(...) LV_RESULT_INVALID
#define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565_WITH_MASK(...) LV_RESULT_INVALID
#define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA(...) LV_RESULT_INVALID
#define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565(...) LV_RESULT_INVALID
#define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565_WITH_OPA(...) LV_RESULT_INVALID
#define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565_WITH_MASK(...) LV_RESULT_INVALID
#define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA(...) LV_RESULT_INVALID
#endif
/**********************
* GLOBAL FUNCTIONS
**********************/
@@ -96,142 +117,137 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_sw_blend_color_to_rgb565(_lv_draw_sw_blend_fi
/*Simple fill*/
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++) {
uint16_t * dest_end_final = dest_buf_u16 + w;
uint32_t * dest_end_mid = (uint32_t *)((uint16_t *) dest_buf_u16 + ((w - 1) & ~(0xF)));
if((lv_uintptr_t)&dest_buf_u16[0] & 0x3) {
dest_buf_u16[0] = color16;
dest_buf_u16++;
if(LV_RESULT_INVALID == LV_DRAW_SW_COLOR_BLEND_TO_RGB565(dsc)) {
for(y = 0; y < h; y++) {
uint16_t * dest_end_final = dest_buf_u16 + w;
uint32_t * dest_end_mid = (uint32_t *)((uint16_t *) dest_buf_u16 + ((w - 1) & ~(0xF)));
if((lv_uintptr_t)&dest_buf_u16[0] & 0x3) {
dest_buf_u16[0] = color16;
dest_buf_u16++;
}
uint32_t c32 = (uint32_t)color16 + ((uint32_t)color16 << 16);
uint32_t * dest32 = (uint32_t *)dest_buf_u16;
while(dest32 < dest_end_mid) {
dest32[0] = c32;
dest32[1] = c32;
dest32[2] = c32;
dest32[3] = c32;
dest32[4] = c32;
dest32[5] = c32;
dest32[6] = c32;
dest32[7] = c32;
dest32 += 8;
}
dest_buf_u16 = (uint16_t *)dest32;
while(dest_buf_u16 < dest_end_final) {
*dest_buf_u16 = color16;
dest_buf_u16++;
}
dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride);
dest_buf_u16 -= w;
}
uint32_t c32 = (uint32_t)color16 + ((uint32_t)color16 << 16);
uint32_t * dest32 = (uint32_t *)dest_buf_u16;
while(dest32 < dest_end_mid) {
dest32[0] = c32;
dest32[1] = c32;
dest32[2] = c32;
dest32[3] = c32;
dest32[4] = c32;
dest32[5] = c32;
dest32[6] = c32;
dest32[7] = c32;
dest32 += 8;
}
dest_buf_u16 = (uint16_t *)dest32;
while(dest_buf_u16 < dest_end_final) {
*dest_buf_u16 = color16;
dest_buf_u16++;
}
dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride);
dest_buf_u16 -= w;
}
#endif
}
/*Opacity only*/
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_res32_color = 0;
if(LV_RESULT_INVALID == LV_DRAW_SW_COLOR_BLEND_TO_RGB565_WITH_OPA(dsc)) {
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;
for(y = 0; y < h; y++) {
x = 0;
if((lv_uintptr_t)&dest_buf_u16[0] & 0x3) {
dest_buf_u16[0] = lv_color_16_16_mix(color16, dest_buf_u16[0], opa);
x = 1;
}
for(; x < w - 2; x += 2) {
if(dest_buf_u16[x] != dest_buf_u16[x + 1]) {
dest_buf_u16[x + 0] = lv_color_16_16_mix(color16, dest_buf_u16[x + 0], opa);
dest_buf_u16[x + 1] = lv_color_16_16_mix(color16, dest_buf_u16[x + 1], opa);
for(y = 0; y < h; y++) {
x = 0;
if((lv_uintptr_t)&dest_buf_u16[0] & 0x3) {
dest_buf_u16[0] = lv_color_16_16_mix(color16, dest_buf_u16[0], opa);
x = 1;
}
else {
volatile uint32_t * dest32 = (uint32_t *)&dest_buf_u16[x];
if(last_dest32_color == *dest32) {
*dest32 = last_res32_color;
for(; x < w - 2; x += 2) {
if(dest_buf_u16[x] != dest_buf_u16[x + 1]) {
dest_buf_u16[x + 0] = lv_color_16_16_mix(color16, dest_buf_u16[x + 0], opa);
dest_buf_u16[x + 1] = lv_color_16_16_mix(color16, dest_buf_u16[x + 1], opa);
}
else {
last_dest32_color = *dest32;
volatile uint32_t * dest32 = (uint32_t *)&dest_buf_u16[x];
if(last_dest32_color == *dest32) {
*dest32 = last_res32_color;
}
else {
last_dest32_color = *dest32;
dest_buf_u16[x] = lv_color_16_16_mix(color16, dest_buf_u16[x + 0], opa);
dest_buf_u16[x + 1] = dest_buf_u16[x];
dest_buf_u16[x] = lv_color_16_16_mix(color16, dest_buf_u16[x + 0], opa);
dest_buf_u16[x + 1] = dest_buf_u16[x];
last_res32_color = *dest32;
last_res32_color = *dest32;
}
}
}
}
for(; x < w ; x++) {
dest_buf_u16[x] = lv_color_16_16_mix(color16, dest_buf_u16[x], opa);
for(; x < w ; x++) {
dest_buf_u16[x] = lv_color_16_16_mix(color16, dest_buf_u16[x], opa);
}
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*/
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);
for(y = 0; y < h; y++) {
for(x = 0; x < w && ((lv_uintptr_t)(mask) & 0x3); x++) {
dest_buf_u16[x] = lv_color_16_16_mix(color16, dest_buf_u16[x], mask[x]);
}
if(LV_RESULT_INVALID == LV_DRAW_SW_COLOR_BLEND_TO_RGB565_WITH_MASK(dsc)) {
uint32_t c32 = color16 + ((uint32_t)color16 << 16);
for(y = 0; y < h; y++) {
for(x = 0; x < w && ((lv_uintptr_t)(mask) & 0x3); x++) {
dest_buf_u16[x] = lv_color_16_16_mix(color16, dest_buf_u16[x], mask[x]);
}
for(; x <= w - 4; x += 4) {
uint32_t mask32 = *((uint32_t *)&mask[x]);
if(mask32 == 0xFFFFFFFF) {
if((lv_uintptr_t)&dest_buf_u16[x] & 0x3) {
dest_buf_u16[x] = color16;
uint32_t * d32 = (uint32_t *)(&dest_buf_u16[x + 1]);
*d32 = c32;
dest_buf_u16[x + 3] = color16;
for(; x <= w - 4; x += 4) {
uint32_t mask32 = *((uint32_t *)&mask[x]);
if(mask32 == 0xFFFFFFFF) {
if((lv_uintptr_t)&dest_buf_u16[x] & 0x3) {
dest_buf_u16[x] = color16;
uint32_t * d32 = (uint32_t *)(&dest_buf_u16[x + 1]);
*d32 = c32;
dest_buf_u16[x + 3] = color16;
}
else {
uint32_t * dest32 = (uint32_t *)&dest_buf_u16[x];
dest32[0] = c32;
dest32[1] = c32;
}
}
else {
uint32_t * dest32 = (uint32_t *)&dest_buf_u16[x];
dest32[0] = c32;
dest32[1] = c32;
else if(mask32) {
dest_buf_u16[x + 0] = lv_color_16_16_mix(color16, dest_buf_u16[x + 0], mask[x + 0]);
dest_buf_u16[x + 1] = lv_color_16_16_mix(color16, dest_buf_u16[x + 1], mask[x + 1]);
dest_buf_u16[x + 2] = lv_color_16_16_mix(color16, dest_buf_u16[x + 2], mask[x + 2]);
dest_buf_u16[x + 3] = lv_color_16_16_mix(color16, dest_buf_u16[x + 3], mask[x + 3]);
}
}
else if(mask32) {
dest_buf_u16[x + 0] = lv_color_16_16_mix(color16, dest_buf_u16[x + 0], mask[x + 0]);
dest_buf_u16[x + 1] = lv_color_16_16_mix(color16, dest_buf_u16[x + 1], mask[x + 1]);
dest_buf_u16[x + 2] = lv_color_16_16_mix(color16, dest_buf_u16[x + 2], mask[x + 2]);
dest_buf_u16[x + 3] = lv_color_16_16_mix(color16, dest_buf_u16[x + 3], mask[x + 3]);
}
}
for(; x < w ; x++) {
dest_buf_u16[x] = lv_color_16_16_mix(color16, dest_buf_u16[x], mask[x]);
for(; x < w ; x++) {
dest_buf_u16[x] = lv_color_16_16_mix(color16, dest_buf_u16[x], mask[x]);
}
dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride);
mask += mask_stride;
}
dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride);
mask += mask_stride;
}
#endif
}
/*Masked with opacity*/
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(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));
if(LV_RESULT_INVALID == LV_DRAW_SW_COLOR_BLEND_TO_RGB565_MIX_MASK_OPA(dsc)) {
for(y = 0; y < h; y++) {
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 = drawbuf_next_row(dest_buf_u16, dest_stride);
mask += mask_stride;
}
dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride);
mask += mask_stride;
}
#endif
}
}
@@ -277,57 +293,49 @@ LV_ATTRIBUTE_FAST_MEM static void rgb565_image_blend(_lv_draw_sw_blend_image_dsc
if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) {
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;
for(y = 0; y < h; y++) {
lv_memcpy(dest_buf_u16, src_buf_u16, line_in_bytes);
dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride);
src_buf_u16 = drawbuf_next_row(src_buf_u16, src_stride);
if(LV_RESULT_INVALID == LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565(dsc)) {
uint32_t line_in_bytes = w * 2;
for(y = 0; y < h; y++) {
lv_memcpy(dest_buf_u16, src_buf_u16, line_in_bytes);
dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride);
src_buf_u16 = drawbuf_next_row(src_buf_u16, src_stride);
}
}
#endif
}
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(x = 0; x < w; x++) {
dest_buf_u16[x] = lv_color_16_16_mix(src_buf_u16[x], dest_buf_u16[x], opa);
if(LV_RESULT_INVALID == LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565_WITH_OPA(dsc)) {
for(y = 0; y < h; y++) {
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 = drawbuf_next_row(dest_buf_u16, dest_stride);
src_buf_u16 = drawbuf_next_row(src_buf_u16, src_stride);
}
dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride);
src_buf_u16 = drawbuf_next_row(src_buf_u16, src_stride);
}
#endif
}
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(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]);
if(LV_RESULT_INVALID == LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565_WITH_MASK(dsc)) {
for(y = 0; y < h; y++) {
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 = drawbuf_next_row(dest_buf_u16, dest_stride);
src_buf_u16 = drawbuf_next_row(src_buf_u16, src_stride);
mask_buf += mask_stride;
}
dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride);
src_buf_u16 = drawbuf_next_row(src_buf_u16, src_stride);
mask_buf += mask_stride;
}
#endif
}
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(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));
if(LV_RESULT_INVALID == LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA(dsc)) {
for(y = 0; y < h; y++) {
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 = drawbuf_next_row(dest_buf_u16, dest_stride);
src_buf_u16 = drawbuf_next_row(src_buf_u16, src_stride);
mask_buf += mask_stride;
}
dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride);
src_buf_u16 = drawbuf_next_row(src_buf_u16, src_stride);
mask_buf += mask_stride;
}
#endif
}
}
else {
@@ -394,60 +402,52 @@ LV_ATTRIBUTE_FAST_MEM static void rgb888_image_blend(_lv_draw_sw_blend_image_dsc
if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) {
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(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) +
((src_buf_u8[src_x + 1] & 0xFC) << 3) +
((src_buf_u8[src_x + 0] & 0xF8) >> 3);
if(LV_RESULT_INVALID == LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565(dsc, src_px_size)) {
for(y = 0; y < h; y++) {
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) +
((src_buf_u8[src_x + 1] & 0xFC) << 3) +
((src_buf_u8[src_x + 0] & 0xF8) >> 3);
}
dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride);
src_buf_u8 += src_stride;
}
dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride);
src_buf_u8 += src_stride;
}
#endif
}
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(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);
if(LV_RESULT_INVALID == LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565_WITH_OPA(dsc, src_px_size)) {
for(y = 0; y < h; y++) {
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 = drawbuf_next_row(dest_buf_u16, dest_stride);
src_buf_u8 += src_stride;
}
dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride);
src_buf_u8 += src_stride;
}
#endif
}
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(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]);
if(LV_RESULT_INVALID == LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565_WITH_MASK(dsc, src_px_size)) {
for(y = 0; y < h; y++) {
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 = drawbuf_next_row(dest_buf_u16, dest_stride);
src_buf_u8 += src_stride;
mask_buf += mask_stride;
}
dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride);
src_buf_u8 += src_stride;
mask_buf += mask_stride;
}
#endif
}
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(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));
if(LV_RESULT_INVALID == LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA(dsc, src_px_size)) {
for(y = 0; y < h; y++) {
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 = drawbuf_next_row(dest_buf_u16, dest_stride);
src_buf_u8 += src_stride;
mask_buf += mask_stride;
}
dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride);
src_buf_u8 += src_stride;
mask_buf += mask_stride;
}
#endif
}
}
else {
@@ -510,61 +510,53 @@ LV_ATTRIBUTE_FAST_MEM static void argb8888_image_blend(_lv_draw_sw_blend_image_d
if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) {
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(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]);
if(LV_RESULT_INVALID == LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565(dsc)) {
for(y = 0; y < h; y++) {
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 = drawbuf_next_row(dest_buf_u16, dest_stride);
src_buf_u8 += src_stride;
}
dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride);
src_buf_u8 += src_stride;
}
#endif
}
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(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],
opa));
if(LV_RESULT_INVALID == LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565_WITH_OPA(dsc)) {
for(y = 0; y < h; y++) {
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],
opa));
}
dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride);
src_buf_u8 += src_stride;
}
dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride);
src_buf_u8 += src_stride;
}
#endif
}
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(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], mask_buf[dest_x]));
if(LV_RESULT_INVALID == LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565_WITH_MASK(dsc)) {
for(y = 0; y < h; y++) {
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], mask_buf[dest_x]));
}
dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride);
src_buf_u8 += src_stride;
mask_buf += mask_stride;
}
dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride);
src_buf_u8 += src_stride;
mask_buf += mask_stride;
}
#endif
}
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(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_MIX3(src_buf_u8[src_x + 3], mask_buf[dest_x], opa));
if(LV_RESULT_INVALID == LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB565_MIX_MASK_OPA(dsc)) {
for(y = 0; y < h; y++) {
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_MIX3(src_buf_u8[src_x + 3], mask_buf[dest_x], opa));
}
dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride);
src_buf_u8 += src_stride;
mask_buf += mask_stride;
}
dest_buf_u16 = drawbuf_next_row(dest_buf_u16, dest_stride);
src_buf_u8 += src_stride;
mask_buf += mask_stride;
}
#endif
}
}
else {

View File

@@ -18,6 +18,8 @@
#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_HELIUM
#include "helium/lv_blend_helium.h"
#elif LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_CUSTOM
#include LV_DRAW_SW_ASM_CUSTOM_INCLUDE
#endif
@@ -54,6 +56,25 @@ LV_ATTRIBUTE_FAST_MEM static inline void * drawbuf_next_row(const void * buf, ui
* MACROS
**********************/
#if LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_NONE
#define LV_DRAW_SW_COLOR_BLEND_TO_RGB888(...) LV_RESULT_INVALID
#define LV_DRAW_SW_COLOR_BLEND_TO_RGB888_WITH_OPA(...) LV_RESULT_INVALID
#define LV_DRAW_SW_COLOR_BLEND_TO_RGB888_WITH_MASK(...) LV_RESULT_INVALID
#define LV_DRAW_SW_COLOR_BLEND_TO_RGB888_MIX_MASK_OPA(...) LV_RESULT_INVALID
#define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888(...) LV_RESULT_INVALID
#define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888_WITH_OPA(...) LV_RESULT_INVALID
#define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888_WITH_MASK(...) LV_RESULT_INVALID
#define LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA(...) LV_RESULT_INVALID
#define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888(...) LV_RESULT_INVALID
#define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888_WITH_OPA(...) LV_RESULT_INVALID
#define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888_WITH_MASK(...) LV_RESULT_INVALID
#define LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA(...) LV_RESULT_INVALID
#define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888(...) LV_RESULT_INVALID
#define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888_WITH_OPA(...) LV_RESULT_INVALID
#define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888_WITH_MASK(...) LV_RESULT_INVALID
#define LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA(...) LV_RESULT_INVALID
#endif
/**********************
* GLOBAL FUNCTIONS
**********************/
@@ -81,115 +102,107 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_sw_blend_color_to_rgb888(_lv_draw_sw_blend_fi
/*Simple fill*/
if(mask == NULL && opa >= LV_OPA_MAX) {
#ifdef LV_DRAW_SW_COLOR_BLEND_TO_RGB888
LV_DRAW_SW_COLOR_BLEND_TO_RGB888(dsc, dest_px_size);
#else
if(dest_px_size == 3) {
uint8_t * dest_buf_u8 = dsc->dest_buf;
uint8_t * dest_buf_ori = dsc->dest_buf;
w *= dest_px_size;
if(LV_RESULT_INVALID == LV_DRAW_SW_COLOR_BLEND_TO_RGB888(dsc, dest_px_size)) {
if(dest_px_size == 3) {
uint8_t * dest_buf_u8 = dsc->dest_buf;
uint8_t * dest_buf_ori = dsc->dest_buf;
w *= dest_px_size;
for(x = 0; x < w; x += 3) {
dest_buf_u8[x + 0] = dsc->color.blue;
dest_buf_u8[x + 1] = dsc->color.green;
dest_buf_u8[x + 2] = dsc->color.red;
}
for(x = 0; x < w; x += 3) {
dest_buf_u8[x + 0] = dsc->color.blue;
dest_buf_u8[x + 1] = dsc->color.green;
dest_buf_u8[x + 2] = dsc->color.red;
}
dest_buf_u8 += dest_stride;
for(y = 1; y < h; y++) {
lv_memcpy(dest_buf_u8, dest_buf_ori, w);
dest_buf_u8 += dest_stride;
for(y = 1; y < h; y++) {
lv_memcpy(dest_buf_u8, dest_buf_ori, w);
dest_buf_u8 += dest_stride;
}
}
if(dest_px_size == 4) {
uint32_t color32 = lv_color_to_u32(dsc->color);
uint32_t * dest_buf_u32 = dsc->dest_buf;
for(y = 0; y < h; y++) {
for(x = 0; x <= w - 16; x += 16) {
dest_buf_u32[x + 0] = color32;
dest_buf_u32[x + 1] = color32;
dest_buf_u32[x + 2] = color32;
dest_buf_u32[x + 3] = color32;
dest_buf_u32[x + 4] = color32;
dest_buf_u32[x + 5] = color32;
dest_buf_u32[x + 6] = color32;
dest_buf_u32[x + 7] = color32;
dest_buf_u32[x + 8] = color32;
dest_buf_u32[x + 9] = color32;
dest_buf_u32[x + 10] = color32;
dest_buf_u32[x + 11] = color32;
dest_buf_u32[x + 12] = color32;
dest_buf_u32[x + 13] = color32;
dest_buf_u32[x + 14] = color32;
dest_buf_u32[x + 15] = color32;
}
for(; x < w; x ++) {
dest_buf_u32[x] = color32;
}
dest_buf_u32 = drawbuf_next_row(dest_buf_u32, dest_stride);
}
}
}
if(dest_px_size == 4) {
uint32_t color32 = lv_color_to_u32(dsc->color);
uint32_t * dest_buf_u32 = dsc->dest_buf;
for(y = 0; y < h; y++) {
for(x = 0; x <= w - 16; x += 16) {
dest_buf_u32[x + 0] = color32;
dest_buf_u32[x + 1] = color32;
dest_buf_u32[x + 2] = color32;
dest_buf_u32[x + 3] = color32;
dest_buf_u32[x + 4] = color32;
dest_buf_u32[x + 5] = color32;
dest_buf_u32[x + 6] = color32;
dest_buf_u32[x + 7] = color32;
dest_buf_u32[x + 8] = color32;
dest_buf_u32[x + 9] = color32;
dest_buf_u32[x + 10] = color32;
dest_buf_u32[x + 11] = color32;
dest_buf_u32[x + 12] = color32;
dest_buf_u32[x + 13] = color32;
dest_buf_u32[x + 14] = color32;
dest_buf_u32[x + 15] = color32;
}
for(; x < w; x ++) {
dest_buf_u32[x] = color32;
}
dest_buf_u32 = drawbuf_next_row(dest_buf_u32, dest_stride);
}
}
#endif
}
/*Opacity only*/
else if(mask == NULL && opa < LV_OPA_MAX) {
#ifdef LV_DRAW_SW_COLOR_BLEND_TO_RGB888_WITH_OPA
LV_DRAW_SW_COLOR_BLEND_TO_RGB888_WITH_OPA(dsc, dest_px_size);
#else
uint32_t color32 = lv_color_to_u32(dsc->color);
uint8_t * dest_buf = dsc->dest_buf;
w *= dest_px_size;
for(y = 0; y < h; y++) {
for(x = 0; x < w; x += dest_px_size) {
lv_color_24_24_mix((const uint8_t *)&color32, &dest_buf[x], opa);
}
if(LV_RESULT_INVALID == LV_DRAW_SW_COLOR_BLEND_TO_RGB888_WITH_OPA(dsc, dest_px_size)) {
uint32_t color32 = lv_color_to_u32(dsc->color);
uint8_t * dest_buf = dsc->dest_buf;
w *= dest_px_size;
for(y = 0; y < h; y++) {
for(x = 0; x < w; x += dest_px_size) {
lv_color_24_24_mix((const uint8_t *)&color32, &dest_buf[x], opa);
}
dest_buf = drawbuf_next_row(dest_buf, dest_stride);
dest_buf = drawbuf_next_row(dest_buf, dest_stride);
}
}
#endif
}
/*Masked with full opacity*/
else if(mask && opa >= LV_OPA_MAX) {
#ifdef LV_DRAW_SW_COLOR_BLEND_TO_RGB888_WITH_MASK
LV_DRAW_SW_COLOR_BLEND_TO_RGB888_WITH_MASK(dsc, dest_px_size);
#else
uint32_t color32 = lv_color_to_u32(dsc->color);
uint8_t * dest_buf = dsc->dest_buf;
w *= dest_px_size;
if(LV_RESULT_INVALID == LV_DRAW_SW_COLOR_BLEND_TO_RGB888_WITH_MASK(dsc, dest_px_size)) {
uint32_t color32 = lv_color_to_u32(dsc->color);
uint8_t * dest_buf = dsc->dest_buf;
w *= dest_px_size;
for(y = 0; y < h; y++) {
uint32_t mask_x;
for(x = 0, mask_x = 0; x < w; x += dest_px_size, mask_x++) {
lv_color_24_24_mix((const uint8_t *)&color32, &dest_buf[x], mask[mask_x]);
for(y = 0; y < h; y++) {
uint32_t mask_x;
for(x = 0, mask_x = 0; x < w; x += dest_px_size, mask_x++) {
lv_color_24_24_mix((const uint8_t *)&color32, &dest_buf[x], mask[mask_x]);
}
dest_buf += dest_stride;
mask += mask_stride;
}
dest_buf += dest_stride;
mask += mask_stride;
}
#endif
}
/*Masked with opacity*/
else {
#ifdef LV_DRAW_SW_COLOR_BLEND_TO_RGB888_MIX_MASK_OPA
LV_DRAW_SW_COLOR_BLEND_TO_RGB888_MIX_MASK_OPA(dsc, dest_px_size);
#else
uint32_t color32 = lv_color_to_u32(dsc->color);
uint8_t * dest_buf = dsc->dest_buf;
w *= dest_px_size;
if(LV_RESULT_INVALID == LV_DRAW_SW_COLOR_BLEND_TO_RGB888_MIX_MASK_OPA(dsc, dest_px_size)) {
uint32_t color32 = lv_color_to_u32(dsc->color);
uint8_t * dest_buf = dsc->dest_buf;
w *= dest_px_size;
for(y = 0; y < h; y++) {
uint32_t mask_x;
for(x = 0, mask_x = 0; x < w; x += dest_px_size, mask_x++) {
lv_color_24_24_mix((const uint8_t *) &color32, &dest_buf[x], LV_OPA_MIX2(opa, mask[mask_x]));
for(y = 0; y < h; y++) {
uint32_t mask_x;
for(x = 0, mask_x = 0; x < w; x += dest_px_size, mask_x++) {
lv_color_24_24_mix((const uint8_t *) &color32, &dest_buf[x], LV_OPA_MIX2(opa, mask[mask_x]));
}
dest_buf += dest_stride;
mask += mask_stride;
}
dest_buf += dest_stride;
mask += mask_stride;
}
#endif
}
}
@@ -237,72 +250,64 @@ LV_ATTRIBUTE_FAST_MEM static void rgb565_image_blend(_lv_draw_sw_blend_image_dsc
if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) {
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(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 + 1] = (src_buf_c16[src_x].green * 1037) >> 8;
dest_buf_u8[dest_x + 0] = (src_buf_c16[src_x].blue * 2106) >> 8;
if(LV_RESULT_INVALID == LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888(dsc, dest_px_size)) {
for(y = 0; y < h; y++) {
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 + 1] = (src_buf_c16[src_x].green * 1037) >> 8;
dest_buf_u8[dest_x + 0] = (src_buf_c16[src_x].blue * 2106) >> 8;
}
dest_buf_u8 += dest_stride;
src_buf_c16 = drawbuf_next_row(src_buf_c16, src_stride);
}
dest_buf_u8 += dest_stride;
src_buf_c16 = drawbuf_next_row(src_buf_c16, src_stride);
}
#endif
}
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];
for(y = 0; y < h; y++) {
for(src_x = 0, dest_x = 0; src_x < w; dest_x += dest_px_size, src_x++) {
res[2] = (src_buf_c16[src_x].red * 2106) >> 8; /*To make it rounded*/
res[1] = (src_buf_c16[src_x].green * 1037) >> 8;
res[0] = (src_buf_c16[src_x].blue * 2106) >> 8;
lv_color_24_24_mix(res, &dest_buf_u8[dest_x], opa);
if(LV_RESULT_INVALID == LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888_WITH_OPA(dsc, dest_px_size)) {
uint8_t res[3];
for(y = 0; y < h; y++) {
for(src_x = 0, dest_x = 0; src_x < w; dest_x += dest_px_size, src_x++) {
res[2] = (src_buf_c16[src_x].red * 2106) >> 8; /*To make it rounded*/
res[1] = (src_buf_c16[src_x].green * 1037) >> 8;
res[0] = (src_buf_c16[src_x].blue * 2106) >> 8;
lv_color_24_24_mix(res, &dest_buf_u8[dest_x], opa);
}
dest_buf_u8 += dest_stride;
src_buf_c16 = drawbuf_next_row(src_buf_c16, src_stride);
}
dest_buf_u8 += dest_stride;
src_buf_c16 = drawbuf_next_row(src_buf_c16, src_stride);
}
#endif
}
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];
for(y = 0; y < h; y++) {
for(src_x = 0, dest_x = 0; src_x < w; dest_x += dest_px_size, src_x++) {
res[2] = (src_buf_c16[src_x].red * 2106) >> 8; /*To make it rounded*/
res[1] = (src_buf_c16[src_x].green * 1037) >> 8;
res[0] = (src_buf_c16[src_x].blue * 2106) >> 8;
lv_color_24_24_mix(res, &dest_buf_u8[dest_x], mask_buf[src_x]);
if(LV_RESULT_INVALID == LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888_WITH_MASK(dsc, dest_px_size)) {
uint8_t res[3];
for(y = 0; y < h; y++) {
for(src_x = 0, dest_x = 0; src_x < w; dest_x += dest_px_size, src_x++) {
res[2] = (src_buf_c16[src_x].red * 2106) >> 8; /*To make it rounded*/
res[1] = (src_buf_c16[src_x].green * 1037) >> 8;
res[0] = (src_buf_c16[src_x].blue * 2106) >> 8;
lv_color_24_24_mix(res, &dest_buf_u8[dest_x], mask_buf[src_x]);
}
dest_buf_u8 += dest_stride;
src_buf_c16 = drawbuf_next_row(src_buf_c16, src_stride);
mask_buf += mask_stride;
}
dest_buf_u8 += dest_stride;
src_buf_c16 = drawbuf_next_row(src_buf_c16, src_stride);
mask_buf += mask_stride;
}
#endif
}
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];
for(y = 0; y < h; y++) {
for(src_x = 0, dest_x = 0; src_x < w; dest_x += dest_px_size, src_x++) {
res[2] = (src_buf_c16[src_x].red * 2106) >> 8; /*To make it rounded*/
res[1] = (src_buf_c16[src_x].green * 1037) >> 8;
res[0] = (src_buf_c16[src_x].blue * 2106) >> 8;
lv_color_24_24_mix(res, &dest_buf_u8[dest_x], LV_OPA_MIX2(opa, mask_buf[src_x]));
if(LV_RESULT_INVALID == LV_DRAW_SW_RGB565_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA(dsc, dest_px_size)) {
uint8_t res[3];
for(y = 0; y < h; y++) {
for(src_x = 0, dest_x = 0; src_x < w; dest_x += dest_px_size, src_x++) {
res[2] = (src_buf_c16[src_x].red * 2106) >> 8; /*To make it rounded*/
res[1] = (src_buf_c16[src_x].green * 1037) >> 8;
res[0] = (src_buf_c16[src_x].blue * 2106) >> 8;
lv_color_24_24_mix(res, &dest_buf_u8[dest_x], LV_OPA_MIX2(opa, mask_buf[src_x]));
}
dest_buf_u8 += dest_stride;
src_buf_c16 = drawbuf_next_row(src_buf_c16, src_stride);
mask_buf += mask_stride;
}
dest_buf_u8 += dest_stride;
src_buf_c16 = drawbuf_next_row(src_buf_c16, src_stride);
mask_buf += mask_stride;
}
#endif
}
}
else {
@@ -343,71 +348,63 @@ LV_ATTRIBUTE_FAST_MEM static void rgb888_image_blend(_lv_draw_sw_blend_image_dsc
if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) {
/*Special case*/
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) {
for(y = 0; y < h; y++) {
lv_memcpy(dest_buf, src_buf, w);
dest_buf += dest_stride;
src_buf += src_stride;
if(LV_RESULT_INVALID == LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888(dsc, dest_px_size, src_px_size)) {
if(src_px_size == dest_px_size) {
for(y = 0; y < h; y++) {
lv_memcpy(dest_buf, src_buf, w);
dest_buf += dest_stride;
src_buf += src_stride;
}
}
else {
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) {
dest_buf[dest_x + 0] = src_buf[src_x + 0];
dest_buf[dest_x + 1] = src_buf[src_x + 1];
dest_buf[dest_x + 2] = src_buf[src_x + 2];
}
dest_buf += dest_stride;
src_buf += src_stride;
}
}
}
else {
}
if(mask_buf == NULL && opa < LV_OPA_MAX) {
if(LV_RESULT_INVALID == LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888_WITH_OPA(dsc, dest_px_size, src_px_size)) {
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) {
dest_buf[dest_x + 0] = src_buf[src_x + 0];
dest_buf[dest_x + 1] = src_buf[src_x + 1];
dest_buf[dest_x + 2] = src_buf[src_x + 2];
lv_color_24_24_mix(&src_buf[src_x], &dest_buf[dest_x], opa);
}
dest_buf += dest_stride;
src_buf += src_stride;
}
}
#endif
}
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(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);
}
dest_buf += dest_stride;
src_buf += src_stride;
}
#endif
}
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;
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) {
lv_color_24_24_mix(&src_buf[src_x], &dest_buf[dest_x], mask_buf[mask_x]);
if(LV_RESULT_INVALID == LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888_WITH_MASK(dsc, dest_px_size, src_px_size)) {
uint32_t mask_x;
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) {
lv_color_24_24_mix(&src_buf[src_x], &dest_buf[dest_x], mask_buf[mask_x]);
}
dest_buf += dest_stride;
src_buf += src_stride;
mask_buf += mask_stride;
}
dest_buf += dest_stride;
src_buf += src_stride;
mask_buf += mask_stride;
}
#endif
}
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;
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) {
lv_color_24_24_mix(&src_buf[src_x], &dest_buf[dest_x], LV_OPA_MIX2(opa, mask_buf[mask_x]));
if(LV_RESULT_INVALID == LV_DRAW_SW_RGB888_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA(dsc, dest_px_size, src_px_size)) {
uint32_t mask_x;
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) {
lv_color_24_24_mix(&src_buf[src_x], &dest_buf[dest_x], LV_OPA_MIX2(opa, mask_buf[mask_x]));
}
dest_buf += dest_stride;
src_buf += src_stride;
mask_buf += mask_stride;
}
dest_buf += dest_stride;
src_buf += src_stride;
mask_buf += mask_stride;
}
#endif
}
}
else {
@@ -447,60 +444,52 @@ LV_ATTRIBUTE_FAST_MEM static void argb8888_image_blend(_lv_draw_sw_blend_image_d
if(dsc->blend_mode == LV_BLEND_MODE_NORMAL) {
if(mask_buf == NULL && opa >= LV_OPA_MAX) {
#ifdef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888
LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888(dsc, dest_px_size);
#else
for(y = 0; y < h; y++) {
for(dest_x = 0, src_x = 0; src_x < w; dest_x += dest_px_size, src_x++) {
lv_color_24_24_mix((const uint8_t *)&src_buf_c32[src_x], &dest_buf[dest_x], src_buf_c32[src_x].alpha);
if(LV_RESULT_INVALID == LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888(dsc, dest_px_size)) {
for(y = 0; y < h; y++) {
for(dest_x = 0, src_x = 0; src_x < w; dest_x += dest_px_size, src_x++) {
lv_color_24_24_mix((const uint8_t *)&src_buf_c32[src_x], &dest_buf[dest_x], src_buf_c32[src_x].alpha);
}
dest_buf += dest_stride;
src_buf_c32 = drawbuf_next_row(src_buf_c32, src_stride);
}
dest_buf += dest_stride;
src_buf_c32 = drawbuf_next_row(src_buf_c32, src_stride);
}
#endif
}
else if(mask_buf == NULL && opa < LV_OPA_MAX) {
#ifdef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888_WITH_OPA
LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888_WITH_OPA(dsc, dest_px_size);
#else
for(y = 0; y < h; y++) {
for(dest_x = 0, src_x = 0; src_x < w; dest_x += dest_px_size, src_x++) {
lv_color_24_24_mix((const uint8_t *)&src_buf_c32[src_x], &dest_buf[dest_x], LV_OPA_MIX2(src_buf_c32[src_x].alpha, opa));
if(LV_RESULT_INVALID == LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888_WITH_OPA(dsc, dest_px_size)) {
for(y = 0; y < h; y++) {
for(dest_x = 0, src_x = 0; src_x < w; dest_x += dest_px_size, src_x++) {
lv_color_24_24_mix((const uint8_t *)&src_buf_c32[src_x], &dest_buf[dest_x], LV_OPA_MIX2(src_buf_c32[src_x].alpha, opa));
}
dest_buf += dest_stride;
src_buf_c32 = drawbuf_next_row(src_buf_c32, src_stride);
}
dest_buf += dest_stride;
src_buf_c32 = drawbuf_next_row(src_buf_c32, src_stride);
}
#endif
}
else if(mask_buf && opa >= LV_OPA_MAX) {
#ifdef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888_WITH_MASK
LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888_WITH_MASK(dsc, dest_px_size);
#else
for(y = 0; y < h; y++) {
for(dest_x = 0, src_x = 0; src_x < w; dest_x += dest_px_size, src_x++) {
lv_color_24_24_mix((const uint8_t *)&src_buf_c32[src_x], &dest_buf[dest_x],
LV_OPA_MIX2(src_buf_c32[src_x].alpha, mask_buf[src_x]));
if(LV_RESULT_INVALID == LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888_WITH_MASK(dsc, dest_px_size)) {
for(y = 0; y < h; y++) {
for(dest_x = 0, src_x = 0; src_x < w; dest_x += dest_px_size, src_x++) {
lv_color_24_24_mix((const uint8_t *)&src_buf_c32[src_x], &dest_buf[dest_x],
LV_OPA_MIX2(src_buf_c32[src_x].alpha, mask_buf[src_x]));
}
dest_buf += dest_stride;
src_buf_c32 = drawbuf_next_row(src_buf_c32, src_stride);
mask_buf += mask_stride;
}
dest_buf += dest_stride;
src_buf_c32 = drawbuf_next_row(src_buf_c32, src_stride);
mask_buf += mask_stride;
}
#endif
}
else if(mask_buf && opa < LV_OPA_MAX) {
#ifdef LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA
LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA(dsc, dest_px_size);
#else
for(y = 0; y < h; y++) {
for(dest_x = 0, src_x = 0; src_x < w; dest_x += dest_px_size, src_x++) {
lv_color_24_24_mix((const uint8_t *)&src_buf_c32[src_x], &dest_buf[dest_x],
LV_OPA_MIX3(src_buf_c32[src_x].alpha, mask_buf[src_x], opa));
if(LV_RESULT_INVALID == LV_DRAW_SW_ARGB8888_BLEND_NORMAL_TO_RGB888_MIX_MASK_OPA(dsc, dest_px_size)) {
for(y = 0; y < h; y++) {
for(dest_x = 0, src_x = 0; src_x < w; dest_x += dest_px_size, src_x++) {
lv_color_24_24_mix((const uint8_t *)&src_buf_c32[src_x], &dest_buf[dest_x],
LV_OPA_MIX3(src_buf_c32[src_x].alpha, mask_buf[src_x], opa));
}
dest_buf += dest_stride;
src_buf_c32 = drawbuf_next_row(src_buf_c32, src_stride);
mask_buf += mask_stride;
}
dest_buf += dest_stride;
src_buf_c32 = drawbuf_next_row(src_buf_c32, src_stride);
mask_buf += mask_stride;
}
#endif
}
}
else {

View File

@@ -186,7 +186,7 @@ typedef struct {
**********************/
extern void lv_color_blend_to_rgb565_neon(asm_dsc_t * dsc);
static inline void _lv_color_blend_to_rgb565_neon(_lv_draw_sw_blend_fill_dsc_t * dsc)
static inline lv_result_t _lv_color_blend_to_rgb565_neon(_lv_draw_sw_blend_fill_dsc_t * dsc)
{
asm_dsc_t asm_dsc = {
.dst_buf = dsc->dest_buf,
@@ -197,10 +197,11 @@ static inline void _lv_color_blend_to_rgb565_neon(_lv_draw_sw_blend_fill_dsc_t *
};
lv_color_blend_to_rgb565_neon(&asm_dsc);
return LV_RESULT_OK;
}
extern void lv_color_blend_to_rgb565_with_opa_neon(asm_dsc_t * dsc);
static inline void _lv_color_blend_to_rgb565_with_opa_neon(_lv_draw_sw_blend_fill_dsc_t * dsc)
static inline lv_result_t _lv_color_blend_to_rgb565_with_opa_neon(_lv_draw_sw_blend_fill_dsc_t * dsc)
{
asm_dsc_t asm_dsc = {
.opa = dsc->opa,
@@ -211,10 +212,11 @@ static inline void _lv_color_blend_to_rgb565_with_opa_neon(_lv_draw_sw_blend_fil
.src_buf = &dsc->color
};
lv_color_blend_to_rgb565_with_opa_neon(&asm_dsc);
return LV_RESULT_OK;
}
extern void lv_color_blend_to_rgb565_with_mask_neon(asm_dsc_t * dsc);
static inline void _lv_color_blend_to_rgb565_with_mask_neon(_lv_draw_sw_blend_fill_dsc_t * dsc)
static inline lv_result_t _lv_color_blend_to_rgb565_with_mask_neon(_lv_draw_sw_blend_fill_dsc_t * dsc)
{
asm_dsc_t asm_dsc = {
.dst_buf = dsc->dest_buf,
@@ -226,10 +228,11 @@ static inline void _lv_color_blend_to_rgb565_with_mask_neon(_lv_draw_sw_blend_fi
.mask_stride = dsc->mask_stride
};
lv_color_blend_to_rgb565_with_mask_neon(&asm_dsc);
return LV_RESULT_OK;
}
extern void lv_color_blend_to_rgb565_mix_mask_opa_neon(asm_dsc_t * dsc);
static inline void _lv_color_blend_to_rgb565_mix_mask_opa_neon(_lv_draw_sw_blend_fill_dsc_t * dsc)
static inline lv_result_t _lv_color_blend_to_rgb565_mix_mask_opa_neon(_lv_draw_sw_blend_fill_dsc_t * dsc)
{
asm_dsc_t asm_dsc = {
.opa = dsc->opa,
@@ -242,10 +245,11 @@ static inline void _lv_color_blend_to_rgb565_mix_mask_opa_neon(_lv_draw_sw_blend
.mask_stride = dsc->mask_stride
};
lv_color_blend_to_rgb565_mix_mask_opa_neon(&asm_dsc);
return LV_RESULT_OK;
}
extern void lv_rgb565_blend_normal_to_rgb565_neon(asm_dsc_t * dsc);
static inline void _lv_rgb565_blend_normal_to_rgb565_neon(_lv_draw_sw_blend_image_dsc_t * dsc)
static inline lv_result_t _lv_rgb565_blend_normal_to_rgb565_neon(_lv_draw_sw_blend_image_dsc_t * dsc)
{
asm_dsc_t asm_dsc = {
.dst_buf = dsc->dest_buf,
@@ -256,10 +260,11 @@ static inline void _lv_rgb565_blend_normal_to_rgb565_neon(_lv_draw_sw_blend_imag
.src_stride = dsc->src_stride
};
lv_rgb565_blend_normal_to_rgb565_neon(&asm_dsc);
return LV_RESULT_OK;
}
extern void lv_rgb565_blend_normal_to_rgb565_with_opa_neon(asm_dsc_t * dsc);
static inline void _lv_rgb565_blend_normal_to_rgb565_with_opa_neon(_lv_draw_sw_blend_image_dsc_t * dsc)
static inline lv_result_t _lv_rgb565_blend_normal_to_rgb565_with_opa_neon(_lv_draw_sw_blend_image_dsc_t * dsc)
{
asm_dsc_t asm_dsc = {
.opa = dsc->opa,
@@ -271,10 +276,11 @@ static inline void _lv_rgb565_blend_normal_to_rgb565_with_opa_neon(_lv_draw_sw_b
.src_stride = dsc->src_stride
};
lv_rgb565_blend_normal_to_rgb565_with_opa_neon(&asm_dsc);
return LV_RESULT_OK;
}
extern void lv_rgb565_blend_normal_to_rgb565_with_mask_neon(asm_dsc_t * dsc);
static inline void _lv_rgb565_blend_normal_to_rgb565_with_mask_neon(_lv_draw_sw_blend_image_dsc_t * dsc)
static inline lv_result_t _lv_rgb565_blend_normal_to_rgb565_with_mask_neon(_lv_draw_sw_blend_image_dsc_t * dsc)
{
asm_dsc_t asm_dsc = {
.dst_buf = dsc->dest_buf,
@@ -287,10 +293,11 @@ static inline void _lv_rgb565_blend_normal_to_rgb565_with_mask_neon(_lv_draw_sw_
.mask_stride = dsc->mask_stride
};
lv_rgb565_blend_normal_to_rgb565_with_mask_neon(&asm_dsc);
return LV_RESULT_OK;
}
extern void lv_rgb565_blend_normal_to_rgb565_mix_mask_opa_neon(asm_dsc_t * dsc);
static inline void _lv_rgb565_blend_normal_to_rgb565_mix_mask_opa_neon(_lv_draw_sw_blend_image_dsc_t * dsc)
static inline lv_result_t _lv_rgb565_blend_normal_to_rgb565_mix_mask_opa_neon(_lv_draw_sw_blend_image_dsc_t * dsc)
{
asm_dsc_t asm_dsc = {
.opa = dsc->opa,
@@ -304,11 +311,13 @@ static inline void _lv_rgb565_blend_normal_to_rgb565_mix_mask_opa_neon(_lv_draw_
.mask_stride = dsc->mask_stride
};
lv_rgb565_blend_normal_to_rgb565_mix_mask_opa_neon(&asm_dsc);
return LV_RESULT_OK;
}
extern void lv_rgb888_blend_normal_to_rgb565_neon(asm_dsc_t * dsc);
extern void lv_xrgb8888_blend_normal_to_rgb565_neon(asm_dsc_t * dsc);
static inline void _lv_rgb888_blend_normal_to_rgb565_neon(_lv_draw_sw_blend_image_dsc_t * dsc, uint32_t src_px_size)
static inline lv_result_t _lv_rgb888_blend_normal_to_rgb565_neon(_lv_draw_sw_blend_image_dsc_t * dsc,
uint32_t src_px_size)
{
asm_dsc_t asm_dsc = {
.dst_buf = dsc->dest_buf,
@@ -324,12 +333,13 @@ static inline void _lv_rgb888_blend_normal_to_rgb565_neon(_lv_draw_sw_blend_imag
else {
lv_xrgb8888_blend_normal_to_rgb565_neon(&asm_dsc);
}
return LV_RESULT_OK;
}
extern void lv_rgb888_blend_normal_to_rgb565_with_opa_neon(asm_dsc_t * dsc);
extern void lv_xrgb8888_blend_normal_to_rgb565_with_opa_neon(asm_dsc_t * dsc);
static inline void _lv_rgb888_blend_normal_to_rgb565_with_opa_neon(_lv_draw_sw_blend_image_dsc_t * dsc,
uint32_t src_px_size)
static inline lv_result_t _lv_rgb888_blend_normal_to_rgb565_with_opa_neon(_lv_draw_sw_blend_image_dsc_t * dsc,
uint32_t src_px_size)
{
asm_dsc_t asm_dsc = {
.opa = dsc->opa,
@@ -346,12 +356,13 @@ static inline void _lv_rgb888_blend_normal_to_rgb565_with_opa_neon(_lv_draw_sw_b
else {
lv_xrgb8888_blend_normal_to_rgb565_with_opa_neon(&asm_dsc);
}
return LV_RESULT_OK;
}
extern void lv_rgb888_blend_normal_to_rgb565_with_mask_neon(asm_dsc_t * dsc);
extern void lv_xrgb8888_blend_normal_to_rgb565_with_mask_neon(asm_dsc_t * dsc);
static inline void _lv_rgb888_blend_normal_to_rgb565_with_mask_neon(_lv_draw_sw_blend_image_dsc_t * dsc,
uint32_t src_px_size)
static inline lv_result_t _lv_rgb888_blend_normal_to_rgb565_with_mask_neon(_lv_draw_sw_blend_image_dsc_t * dsc,
uint32_t src_px_size)
{
asm_dsc_t asm_dsc = {
.dst_buf = dsc->dest_buf,
@@ -369,12 +380,13 @@ static inline void _lv_rgb888_blend_normal_to_rgb565_with_mask_neon(_lv_draw_sw_
else {
lv_xrgb8888_blend_normal_to_rgb565_with_mask_neon(&asm_dsc);
}
return LV_RESULT_OK;
}
extern void lv_rgb888_blend_normal_to_rgb565_mix_mask_opa_neon(asm_dsc_t * dsc);
extern void lv_xrgb8888_blend_normal_to_rgb565_mix_mask_opa_neon(asm_dsc_t * dsc);
static inline void _lv_rgb888_blend_normal_to_rgb565_mix_mask_opa_neon(_lv_draw_sw_blend_image_dsc_t * dsc,
uint32_t src_px_size)
static inline lv_result_t _lv_rgb888_blend_normal_to_rgb565_mix_mask_opa_neon(_lv_draw_sw_blend_image_dsc_t * dsc,
uint32_t src_px_size)
{
asm_dsc_t asm_dsc = {
.opa = dsc->opa,
@@ -393,10 +405,11 @@ static inline void _lv_rgb888_blend_normal_to_rgb565_mix_mask_opa_neon(_lv_draw_
else {
lv_xrgb8888_blend_normal_to_rgb565_mix_mask_opa_neon(&asm_dsc);
}
return LV_RESULT_OK;
}
extern void lv_argb8888_blend_normal_to_rgb565_neon(asm_dsc_t * dsc);
static inline void _lv_argb8888_blend_normal_to_rgb565_neon(_lv_draw_sw_blend_image_dsc_t * dsc)
static inline lv_result_t _lv_argb8888_blend_normal_to_rgb565_neon(_lv_draw_sw_blend_image_dsc_t * dsc)
{
asm_dsc_t asm_dsc = {
.dst_buf = dsc->dest_buf,
@@ -407,10 +420,11 @@ static inline void _lv_argb8888_blend_normal_to_rgb565_neon(_lv_draw_sw_blend_im
.src_stride = dsc->src_stride
};
lv_argb8888_blend_normal_to_rgb565_neon(&asm_dsc);
return LV_RESULT_OK;
}
extern void lv_argb8888_blend_normal_to_rgb565_with_opa_neon(asm_dsc_t * dsc);
static inline void _lv_argb8888_blend_normal_to_rgb565_with_opa_neon(_lv_draw_sw_blend_image_dsc_t * dsc)
static inline lv_result_t _lv_argb8888_blend_normal_to_rgb565_with_opa_neon(_lv_draw_sw_blend_image_dsc_t * dsc)
{
asm_dsc_t asm_dsc = {
.opa = dsc->opa,
@@ -422,10 +436,11 @@ static inline void _lv_argb8888_blend_normal_to_rgb565_with_opa_neon(_lv_draw_sw
.src_stride = dsc->src_stride
};
lv_argb8888_blend_normal_to_rgb565_with_opa_neon(&asm_dsc);
return LV_RESULT_OK;
}
extern void lv_argb8888_blend_normal_to_rgb565_with_mask_neon(asm_dsc_t * dsc);
static inline void _lv_argb8888_blend_normal_to_rgb565_with_mask_neon(_lv_draw_sw_blend_image_dsc_t * dsc)
static inline lv_result_t _lv_argb8888_blend_normal_to_rgb565_with_mask_neon(_lv_draw_sw_blend_image_dsc_t * dsc)
{
asm_dsc_t asm_dsc = {
.dst_buf = dsc->dest_buf,
@@ -438,10 +453,11 @@ static inline void _lv_argb8888_blend_normal_to_rgb565_with_mask_neon(_lv_draw_s
.mask_stride = dsc->mask_stride
};
lv_argb8888_blend_normal_to_rgb565_with_mask_neon(&asm_dsc);
return LV_RESULT_OK;
}
extern void lv_argb8888_blend_normal_to_rgb565_mix_mask_opa_neon(asm_dsc_t * dsc);
static inline void _lv_argb8888_blend_normal_to_rgb565_mix_mask_opa_neon(_lv_draw_sw_blend_image_dsc_t * dsc)
static inline lv_result_t _lv_argb8888_blend_normal_to_rgb565_mix_mask_opa_neon(_lv_draw_sw_blend_image_dsc_t * dsc)
{
asm_dsc_t asm_dsc = {
.opa = dsc->opa,
@@ -455,11 +471,12 @@ static inline void _lv_argb8888_blend_normal_to_rgb565_mix_mask_opa_neon(_lv_dra
.mask_stride = dsc->mask_stride
};
lv_argb8888_blend_normal_to_rgb565_mix_mask_opa_neon(&asm_dsc);
return LV_RESULT_OK;
}
extern void lv_color_blend_to_rgb888_neon(asm_dsc_t * dsc);
extern void lv_color_blend_to_xrgb8888_neon(asm_dsc_t * dsc);
static inline void _lv_color_blend_to_rgb888_neon(_lv_draw_sw_blend_fill_dsc_t * dsc, uint32_t dst_px_size)
static inline lv_result_t _lv_color_blend_to_rgb888_neon(_lv_draw_sw_blend_fill_dsc_t * dsc, uint32_t dst_px_size)
{
asm_dsc_t asm_dsc = {
.dst_buf = dsc->dest_buf,
@@ -474,11 +491,13 @@ static inline void _lv_color_blend_to_rgb888_neon(_lv_draw_sw_blend_fill_dsc_t *
else {
lv_color_blend_to_xrgb8888_neon(&asm_dsc);
}
return LV_RESULT_OK;
}
extern void lv_color_blend_to_rgb888_with_opa_neon(asm_dsc_t * dsc);
extern void lv_color_blend_to_xrgb8888_with_opa_neon(asm_dsc_t * dsc);
static inline void _lv_color_blend_to_rgb888_with_opa_neon(_lv_draw_sw_blend_fill_dsc_t * dsc, uint32_t dst_px_size)
static inline lv_result_t _lv_color_blend_to_rgb888_with_opa_neon(_lv_draw_sw_blend_fill_dsc_t * dsc,
uint32_t dst_px_size)
{
asm_dsc_t asm_dsc = {
.opa = dsc->opa,
@@ -494,11 +513,13 @@ static inline void _lv_color_blend_to_rgb888_with_opa_neon(_lv_draw_sw_blend_fil
else {
lv_color_blend_to_xrgb8888_with_opa_neon(&asm_dsc);
}
return LV_RESULT_OK;
}
extern void lv_color_blend_to_rgb888_with_mask_neon(asm_dsc_t * dsc);
extern void lv_color_blend_to_xrgb8888_with_mask_neon(asm_dsc_t * dsc);
static inline void _lv_color_blend_to_rgb888_with_mask_neon(_lv_draw_sw_blend_fill_dsc_t * dsc, uint32_t dst_px_size)
static inline lv_result_t _lv_color_blend_to_rgb888_with_mask_neon(_lv_draw_sw_blend_fill_dsc_t * dsc,
uint32_t dst_px_size)
{
asm_dsc_t asm_dsc = {
.dst_buf = dsc->dest_buf,
@@ -515,11 +536,13 @@ static inline void _lv_color_blend_to_rgb888_with_mask_neon(_lv_draw_sw_blend_fi
else {
lv_color_blend_to_xrgb8888_with_mask_neon(&asm_dsc);
}
return LV_RESULT_OK;
}
extern void lv_color_blend_to_rgb888_mix_mask_opa_neon(asm_dsc_t * dsc);
extern void lv_color_blend_to_xrgb8888_mix_mask_opa_neon(asm_dsc_t * dsc);
static inline void _lv_color_blend_to_rgb888_mix_mask_opa_neon(_lv_draw_sw_blend_fill_dsc_t * dsc, uint32_t dst_px_size)
static inline lv_result_t _lv_color_blend_to_rgb888_mix_mask_opa_neon(_lv_draw_sw_blend_fill_dsc_t * dsc,
uint32_t dst_px_size)
{
asm_dsc_t asm_dsc = {
.opa = dsc->opa,
@@ -537,11 +560,13 @@ static inline void _lv_color_blend_to_rgb888_mix_mask_opa_neon(_lv_draw_sw_blend
else {
lv_color_blend_to_xrgb8888_mix_mask_opa_neon(&asm_dsc);
}
return LV_RESULT_OK;
}
extern void lv_rgb565_blend_normal_to_rgb888_neon(asm_dsc_t * dsc);
extern void lv_rgb565_blend_normal_to_xrgb8888_neon(asm_dsc_t * dsc);
static inline void _lv_rgb565_blend_normal_to_rgb888_neon(_lv_draw_sw_blend_image_dsc_t * dsc, uint32_t dst_px_size)
static inline lv_result_t _lv_rgb565_blend_normal_to_rgb888_neon(_lv_draw_sw_blend_image_dsc_t * dsc,
uint32_t dst_px_size)
{
asm_dsc_t asm_dsc = {
.dst_buf = dsc->dest_buf,
@@ -557,12 +582,13 @@ static inline void _lv_rgb565_blend_normal_to_rgb888_neon(_lv_draw_sw_blend_imag
else {
lv_rgb565_blend_normal_to_xrgb8888_neon(&asm_dsc);
}
return LV_RESULT_OK;
}
extern void lv_rgb565_blend_normal_to_rgb888_with_opa_neon(asm_dsc_t * dsc);
extern void lv_rgb565_blend_normal_to_xrgb8888_with_opa_neon(asm_dsc_t * dsc);
static inline void _lv_rgb565_blend_normal_to_rgb888_with_opa_neon(_lv_draw_sw_blend_image_dsc_t * dsc,
uint32_t dst_px_size)
static inline lv_result_t _lv_rgb565_blend_normal_to_rgb888_with_opa_neon(_lv_draw_sw_blend_image_dsc_t * dsc,
uint32_t dst_px_size)
{
asm_dsc_t asm_dsc = {
.opa = dsc->opa,
@@ -579,12 +605,13 @@ static inline void _lv_rgb565_blend_normal_to_rgb888_with_opa_neon(_lv_draw_sw_b
else {
lv_rgb565_blend_normal_to_xrgb8888_with_opa_neon(&asm_dsc);
}
return LV_RESULT_OK;
}
extern void lv_rgb565_blend_normal_to_rgb888_with_mask_neon(asm_dsc_t * dsc);
extern void lv_rgb565_blend_normal_to_xrgb8888_with_mask_neon(asm_dsc_t * dsc);
static inline void _lv_rgb565_blend_normal_to_rgb888_with_mask_neon(_lv_draw_sw_blend_image_dsc_t * dsc,
uint32_t dst_px_size)
static inline lv_result_t _lv_rgb565_blend_normal_to_rgb888_with_mask_neon(_lv_draw_sw_blend_image_dsc_t * dsc,
uint32_t dst_px_size)
{
asm_dsc_t asm_dsc = {
.dst_buf = dsc->dest_buf,
@@ -602,12 +629,13 @@ static inline void _lv_rgb565_blend_normal_to_rgb888_with_mask_neon(_lv_draw_sw_
else {
lv_rgb565_blend_normal_to_xrgb8888_with_mask_neon(&asm_dsc);
}
return LV_RESULT_OK;
}
extern void lv_rgb565_blend_normal_to_rgb888_mix_mask_opa_neon(asm_dsc_t * dsc);
extern void lv_rgb565_blend_normal_to_xrgb8888_mix_mask_opa_neon(asm_dsc_t * dsc);
static inline void _lv_rgb565_blend_normal_to_rgb888_mix_mask_opa_neon(_lv_draw_sw_blend_image_dsc_t * dsc,
uint32_t dst_px_size)
static inline lv_result_t _lv_rgb565_blend_normal_to_rgb888_mix_mask_opa_neon(_lv_draw_sw_blend_image_dsc_t * dsc,
uint32_t dst_px_size)
{
asm_dsc_t asm_dsc = {
.opa = dsc->opa,
@@ -626,14 +654,16 @@ static inline void _lv_rgb565_blend_normal_to_rgb888_mix_mask_opa_neon(_lv_draw_
else {
lv_rgb565_blend_normal_to_xrgb8888_mix_mask_opa_neon(&asm_dsc);
}
return LV_RESULT_OK;
}
extern void lv_rgb888_blend_normal_to_rgb888_neon(asm_dsc_t * dsc);
extern void lv_rgb888_blend_normal_to_xrgb8888_neon(asm_dsc_t * dsc);
extern void lv_xrgb8888_blend_normal_to_rgb888_neon(asm_dsc_t * dsc);
extern void lv_xrgb8888_blend_normal_to_xrgb8888_neon(asm_dsc_t * dsc);
static inline void _lv_rgb888_blend_normal_to_rgb888_neon(_lv_draw_sw_blend_image_dsc_t * dsc, uint32_t dst_px_size,
uint32_t src_px_size)
static inline lv_result_t _lv_rgb888_blend_normal_to_rgb888_neon(_lv_draw_sw_blend_image_dsc_t * dsc,
uint32_t dst_px_size,
uint32_t src_px_size)
{
asm_dsc_t asm_dsc = {
.dst_buf = dsc->dest_buf,
@@ -659,14 +689,15 @@ static inline void _lv_rgb888_blend_normal_to_rgb888_neon(_lv_draw_sw_blend_imag
lv_xrgb8888_blend_normal_to_xrgb8888_neon(&asm_dsc);
}
}
return LV_RESULT_OK;
}
extern void lv_rgb888_blend_normal_to_rgb888_with_opa_neon(asm_dsc_t * dsc);
extern void lv_rgb888_blend_normal_to_xrgb8888_with_opa_neon(asm_dsc_t * dsc);
extern void lv_xrgb8888_blend_normal_to_rgb888_with_opa_neon(asm_dsc_t * dsc);
extern void lv_xrgb8888_blend_normal_to_xrgb8888_with_opa_neon(asm_dsc_t * dsc);
static inline void _lv_rgb888_blend_normal_to_rgb888_with_opa_neon(_lv_draw_sw_blend_image_dsc_t * dsc,
uint32_t dst_px_size, uint32_t src_px_size)
static inline lv_result_t _lv_rgb888_blend_normal_to_rgb888_with_opa_neon(_lv_draw_sw_blend_image_dsc_t * dsc,
uint32_t dst_px_size, uint32_t src_px_size)
{
asm_dsc_t asm_dsc = {
.opa = dsc->opa,
@@ -693,14 +724,15 @@ static inline void _lv_rgb888_blend_normal_to_rgb888_with_opa_neon(_lv_draw_sw_b
lv_xrgb8888_blend_normal_to_xrgb8888_with_opa_neon(&asm_dsc);
}
}
return LV_RESULT_OK;
}
extern void lv_rgb888_blend_normal_to_rgb888_with_mask_neon(asm_dsc_t * dsc);
extern void lv_rgb888_blend_normal_to_xrgb8888_with_mask_neon(asm_dsc_t * dsc);
extern void lv_xrgb8888_blend_normal_to_rgb888_with_mask_neon(asm_dsc_t * dsc);
extern void lv_xrgb8888_blend_normal_to_xrgb8888_with_mask_neon(asm_dsc_t * dsc);
static inline void _lv_rgb888_blend_normal_to_rgb888_with_mask_neon(_lv_draw_sw_blend_image_dsc_t * dsc,
uint32_t dst_px_size, uint32_t src_px_size)
static inline lv_result_t _lv_rgb888_blend_normal_to_rgb888_with_mask_neon(_lv_draw_sw_blend_image_dsc_t * dsc,
uint32_t dst_px_size, uint32_t src_px_size)
{
asm_dsc_t asm_dsc = {
.dst_buf = dsc->dest_buf,
@@ -728,14 +760,15 @@ static inline void _lv_rgb888_blend_normal_to_rgb888_with_mask_neon(_lv_draw_sw_
lv_xrgb8888_blend_normal_to_xrgb8888_with_mask_neon(&asm_dsc);
}
}
return LV_RESULT_OK;
}
extern void lv_rgb888_blend_normal_to_rgb888_mix_mask_opa_neon(asm_dsc_t * dsc);
extern void lv_rgb888_blend_normal_to_xrgb8888_mix_mask_opa_neon(asm_dsc_t * dsc);
extern void lv_xrgb8888_blend_normal_to_rgb888_mix_mask_opa_neon(asm_dsc_t * dsc);
extern void lv_xrgb8888_blend_normal_to_xrgb8888_mix_mask_opa_neon(asm_dsc_t * dsc);
static inline void _lv_rgb888_blend_normal_to_rgb888_mix_mask_opa_neon(_lv_draw_sw_blend_image_dsc_t * dsc,
uint32_t dst_px_size, uint32_t src_px_size)
static inline lv_result_t _lv_rgb888_blend_normal_to_rgb888_mix_mask_opa_neon(_lv_draw_sw_blend_image_dsc_t * dsc,
uint32_t dst_px_size, uint32_t src_px_size)
{
asm_dsc_t asm_dsc = {
.opa = dsc->opa,
@@ -764,11 +797,13 @@ static inline void _lv_rgb888_blend_normal_to_rgb888_mix_mask_opa_neon(_lv_draw_
lv_xrgb8888_blend_normal_to_xrgb8888_mix_mask_opa_neon(&asm_dsc);
}
}
return LV_RESULT_OK;
}
extern void lv_argb8888_blend_normal_to_rgb888_neon(asm_dsc_t * dsc);
extern void lv_argb8888_blend_normal_to_xrgb8888_neon(asm_dsc_t * dsc);
static inline void _lv_argb8888_blend_normal_to_rgb888_neon(_lv_draw_sw_blend_image_dsc_t * dsc, uint32_t dst_px_size)
static inline lv_result_t _lv_argb8888_blend_normal_to_rgb888_neon(_lv_draw_sw_blend_image_dsc_t * dsc,
uint32_t dst_px_size)
{
asm_dsc_t asm_dsc = {
.dst_buf = dsc->dest_buf,
@@ -784,12 +819,13 @@ static inline void _lv_argb8888_blend_normal_to_rgb888_neon(_lv_draw_sw_blend_im
else {
lv_argb8888_blend_normal_to_xrgb8888_neon(&asm_dsc);
}
return LV_RESULT_OK;
}
extern void lv_argb8888_blend_normal_to_rgb888_with_opa_neon(asm_dsc_t * dsc);
extern void lv_argb8888_blend_normal_to_xrgb8888_with_opa_neon(asm_dsc_t * dsc);
static inline void _lv_argb8888_blend_normal_to_rgb888_with_opa_neon(_lv_draw_sw_blend_image_dsc_t * dsc,
uint32_t dst_px_size)
static inline lv_result_t _lv_argb8888_blend_normal_to_rgb888_with_opa_neon(_lv_draw_sw_blend_image_dsc_t * dsc,
uint32_t dst_px_size)
{
asm_dsc_t asm_dsc = {
.opa = dsc->opa,
@@ -806,12 +842,13 @@ static inline void _lv_argb8888_blend_normal_to_rgb888_with_opa_neon(_lv_draw_sw
else {
lv_argb8888_blend_normal_to_xrgb8888_with_opa_neon(&asm_dsc);
}
return LV_RESULT_OK;
}
extern void lv_argb8888_blend_normal_to_rgb888_with_mask_neon(asm_dsc_t * dsc);
extern void lv_argb8888_blend_normal_to_xrgb8888_with_mask_neon(asm_dsc_t * dsc);
static inline void _lv_argb8888_blend_normal_to_rgb888_with_mask_neon(_lv_draw_sw_blend_image_dsc_t * dsc,
uint32_t dst_px_size)
static inline lv_result_t _lv_argb8888_blend_normal_to_rgb888_with_mask_neon(_lv_draw_sw_blend_image_dsc_t * dsc,
uint32_t dst_px_size)
{
asm_dsc_t asm_dsc = {
.dst_buf = dsc->dest_buf,
@@ -829,12 +866,13 @@ static inline void _lv_argb8888_blend_normal_to_rgb888_with_mask_neon(_lv_draw_s
else {
lv_argb8888_blend_normal_to_xrgb8888_with_mask_neon(&asm_dsc);
}
return LV_RESULT_OK;
}
extern void lv_argb8888_blend_normal_to_rgb888_mix_mask_opa_neon(asm_dsc_t * dsc);
extern void lv_argb8888_blend_normal_to_xrgb8888_mix_mask_opa_neon(asm_dsc_t * dsc);
static inline void _lv_argb8888_blend_normal_to_rgb888_mix_mask_opa_neon(_lv_draw_sw_blend_image_dsc_t * dsc,
uint32_t dst_px_size)
static inline lv_result_t _lv_argb8888_blend_normal_to_rgb888_mix_mask_opa_neon(_lv_draw_sw_blend_image_dsc_t * dsc,
uint32_t dst_px_size)
{
asm_dsc_t asm_dsc = {
.opa = dsc->opa,
@@ -853,10 +891,11 @@ static inline void _lv_argb8888_blend_normal_to_rgb888_mix_mask_opa_neon(_lv_dra
else {
lv_argb8888_blend_normal_to_xrgb8888_mix_mask_opa_neon(&asm_dsc);
}
return LV_RESULT_OK;
}
extern void lv_color_blend_to_argb8888_neon(asm_dsc_t * dsc);
static inline void _lv_color_blend_to_argb8888_neon(_lv_draw_sw_blend_fill_dsc_t * dsc)
static inline lv_result_t _lv_color_blend_to_argb8888_neon(_lv_draw_sw_blend_fill_dsc_t * dsc)
{
asm_dsc_t asm_dsc = {
.dst_buf = dsc->dest_buf,
@@ -867,10 +906,11 @@ static inline void _lv_color_blend_to_argb8888_neon(_lv_draw_sw_blend_fill_dsc_t
};
lv_color_blend_to_argb8888_neon(&asm_dsc);
return LV_RESULT_OK;
}
extern void lv_color_blend_to_argb8888_with_opa_neon(asm_dsc_t * dsc);
static inline void _lv_color_blend_to_argb8888_with_opa_neon(_lv_draw_sw_blend_fill_dsc_t * dsc)
static inline lv_result_t _lv_color_blend_to_argb8888_with_opa_neon(_lv_draw_sw_blend_fill_dsc_t * dsc)
{
asm_dsc_t asm_dsc = {
.opa = dsc->opa,
@@ -881,10 +921,11 @@ static inline void _lv_color_blend_to_argb8888_with_opa_neon(_lv_draw_sw_blend_f
.src_buf = &dsc->color
};
lv_color_blend_to_argb8888_with_opa_neon(&asm_dsc);
return LV_RESULT_OK;
}
extern void lv_color_blend_to_argb8888_with_mask_neon(asm_dsc_t * dsc);
static inline void _lv_color_blend_to_argb8888_with_mask_neon(_lv_draw_sw_blend_fill_dsc_t * dsc)
static inline lv_result_t _lv_color_blend_to_argb8888_with_mask_neon(_lv_draw_sw_blend_fill_dsc_t * dsc)
{
asm_dsc_t asm_dsc = {
.dst_buf = dsc->dest_buf,
@@ -896,10 +937,11 @@ static inline void _lv_color_blend_to_argb8888_with_mask_neon(_lv_draw_sw_blend_
.mask_stride = dsc->mask_stride
};
lv_color_blend_to_argb8888_with_mask_neon(&asm_dsc);
return LV_RESULT_OK;
}
extern void lv_color_blend_to_argb8888_mix_mask_opa_neon(asm_dsc_t * dsc);
static inline void _lv_color_blend_to_argb8888_mix_mask_opa_neon(_lv_draw_sw_blend_fill_dsc_t * dsc)
static inline lv_result_t _lv_color_blend_to_argb8888_mix_mask_opa_neon(_lv_draw_sw_blend_fill_dsc_t * dsc)
{
asm_dsc_t asm_dsc = {
.opa = dsc->opa,
@@ -912,10 +954,11 @@ static inline void _lv_color_blend_to_argb8888_mix_mask_opa_neon(_lv_draw_sw_ble
.mask_stride = dsc->mask_stride
};
lv_color_blend_to_argb8888_mix_mask_opa_neon(&asm_dsc);
return LV_RESULT_OK;
}
extern void lv_rgb565_blend_normal_to_argb8888_neon(asm_dsc_t * dsc);
static inline void _lv_rgb565_blend_normal_to_argb8888_neon(_lv_draw_sw_blend_image_dsc_t * dsc)
static inline lv_result_t _lv_rgb565_blend_normal_to_argb8888_neon(_lv_draw_sw_blend_image_dsc_t * dsc)
{
asm_dsc_t asm_dsc = {
.dst_buf = dsc->dest_buf,
@@ -926,10 +969,11 @@ static inline void _lv_rgb565_blend_normal_to_argb8888_neon(_lv_draw_sw_blend_im
.src_stride = dsc->src_stride
};
lv_rgb565_blend_normal_to_argb8888_neon(&asm_dsc);
return LV_RESULT_OK;
}
extern void lv_rgb565_blend_normal_to_argb8888_with_opa_neon(asm_dsc_t * dsc);
static inline void _lv_rgb565_blend_normal_to_argb8888_with_opa_neon(_lv_draw_sw_blend_image_dsc_t * dsc)
static inline lv_result_t _lv_rgb565_blend_normal_to_argb8888_with_opa_neon(_lv_draw_sw_blend_image_dsc_t * dsc)
{
asm_dsc_t asm_dsc = {
.opa = dsc->opa,
@@ -941,10 +985,11 @@ static inline void _lv_rgb565_blend_normal_to_argb8888_with_opa_neon(_lv_draw_sw
.src_stride = dsc->src_stride
};
lv_rgb565_blend_normal_to_argb8888_with_opa_neon(&asm_dsc);
return LV_RESULT_OK;
}
extern void lv_rgb565_blend_normal_to_argb8888_with_mask_neon(asm_dsc_t * dsc);
static inline void _lv_rgb565_blend_normal_to_argb8888_with_mask_neon(_lv_draw_sw_blend_image_dsc_t * dsc)
static inline lv_result_t _lv_rgb565_blend_normal_to_argb8888_with_mask_neon(_lv_draw_sw_blend_image_dsc_t * dsc)
{
asm_dsc_t asm_dsc = {
.dst_buf = dsc->dest_buf,
@@ -957,10 +1002,11 @@ static inline void _lv_rgb565_blend_normal_to_argb8888_with_mask_neon(_lv_draw_s
.mask_stride = dsc->mask_stride
};
lv_rgb565_blend_normal_to_argb8888_with_mask_neon(&asm_dsc);
return LV_RESULT_OK;
}
extern void lv_rgb565_blend_normal_to_argb8888_mix_mask_opa_neon(asm_dsc_t * dsc);
static inline void _lv_rgb565_blend_normal_to_argb8888_mix_mask_opa_neon(_lv_draw_sw_blend_image_dsc_t * dsc)
static inline lv_result_t _lv_rgb565_blend_normal_to_argb8888_mix_mask_opa_neon(_lv_draw_sw_blend_image_dsc_t * dsc)
{
asm_dsc_t asm_dsc = {
.opa = dsc->opa,
@@ -974,11 +1020,13 @@ static inline void _lv_rgb565_blend_normal_to_argb8888_mix_mask_opa_neon(_lv_dra
.mask_stride = dsc->mask_stride
};
lv_rgb565_blend_normal_to_argb8888_mix_mask_opa_neon(&asm_dsc);
return LV_RESULT_OK;
}
extern void lv_rgb888_blend_normal_to_argb8888_neon(asm_dsc_t * dsc);
extern void lv_xrgb8888_blend_normal_to_argb8888_neon(asm_dsc_t * dsc);
static inline void _lv_rgb888_blend_normal_to_argb8888_neon(_lv_draw_sw_blend_image_dsc_t * dsc, uint32_t src_px_size)
static inline lv_result_t _lv_rgb888_blend_normal_to_argb8888_neon(_lv_draw_sw_blend_image_dsc_t * dsc,
uint32_t src_px_size)
{
asm_dsc_t asm_dsc = {
.dst_buf = dsc->dest_buf,
@@ -994,12 +1042,13 @@ static inline void _lv_rgb888_blend_normal_to_argb8888_neon(_lv_draw_sw_blend_im
else {
lv_xrgb8888_blend_normal_to_argb8888_neon(&asm_dsc);
}
return LV_RESULT_OK;
}
extern void lv_rgb888_blend_normal_to_argb8888_with_opa_neon(asm_dsc_t * dsc);
extern void lv_xrgb8888_blend_normal_to_argb8888_with_opa_neon(asm_dsc_t * dsc);
static inline void _lv_rgb888_blend_normal_to_argb8888_with_opa_neon(_lv_draw_sw_blend_image_dsc_t * dsc,
uint32_t src_px_size)
static inline lv_result_t _lv_rgb888_blend_normal_to_argb8888_with_opa_neon(_lv_draw_sw_blend_image_dsc_t * dsc,
uint32_t src_px_size)
{
asm_dsc_t asm_dsc = {
.opa = dsc->opa,
@@ -1016,12 +1065,13 @@ static inline void _lv_rgb888_blend_normal_to_argb8888_with_opa_neon(_lv_draw_sw
else {
lv_xrgb8888_blend_normal_to_argb8888_with_opa_neon(&asm_dsc);
}
return LV_RESULT_OK;
}
extern void lv_rgb888_blend_normal_to_argb8888_with_mask_neon(asm_dsc_t * dsc);
extern void lv_xrgb8888_blend_normal_to_argb8888_with_mask_neon(asm_dsc_t * dsc);
static inline void _lv_rgb888_blend_normal_to_argb8888_with_mask_neon(_lv_draw_sw_blend_image_dsc_t * dsc,
uint32_t src_px_size)
static inline lv_result_t _lv_rgb888_blend_normal_to_argb8888_with_mask_neon(_lv_draw_sw_blend_image_dsc_t * dsc,
uint32_t src_px_size)
{
asm_dsc_t asm_dsc = {
.dst_buf = dsc->dest_buf,
@@ -1039,12 +1089,13 @@ static inline void _lv_rgb888_blend_normal_to_argb8888_with_mask_neon(_lv_draw_s
else {
lv_xrgb8888_blend_normal_to_argb8888_with_mask_neon(&asm_dsc);
}
return LV_RESULT_OK;
}
extern void lv_rgb888_blend_normal_to_argb8888_mix_mask_opa_neon(asm_dsc_t * dsc);
extern void lv_xrgb8888_blend_normal_to_argb8888_mix_mask_opa_neon(asm_dsc_t * dsc);
static inline void _lv_rgb888_blend_normal_to_argb8888_mix_mask_opa_neon(_lv_draw_sw_blend_image_dsc_t * dsc,
uint32_t src_px_size)
static inline lv_result_t _lv_rgb888_blend_normal_to_argb8888_mix_mask_opa_neon(_lv_draw_sw_blend_image_dsc_t * dsc,
uint32_t src_px_size)
{
asm_dsc_t asm_dsc = {
.opa = dsc->opa,
@@ -1063,10 +1114,11 @@ static inline void _lv_rgb888_blend_normal_to_argb8888_mix_mask_opa_neon(_lv_dra
else {
lv_xrgb8888_blend_normal_to_argb8888_mix_mask_opa_neon(&asm_dsc);
}
return LV_RESULT_OK;
}
extern void lv_argb8888_blend_normal_to_argb8888_neon(asm_dsc_t * dsc);
static inline void _lv_argb8888_blend_normal_to_argb8888_neon(_lv_draw_sw_blend_image_dsc_t * dsc)
static inline lv_result_t _lv_argb8888_blend_normal_to_argb8888_neon(_lv_draw_sw_blend_image_dsc_t * dsc)
{
asm_dsc_t asm_dsc = {
.dst_buf = dsc->dest_buf,
@@ -1077,10 +1129,11 @@ static inline void _lv_argb8888_blend_normal_to_argb8888_neon(_lv_draw_sw_blend_
.src_stride = dsc->src_stride
};
lv_argb8888_blend_normal_to_argb8888_neon(&asm_dsc);
return LV_RESULT_OK;
}
extern void lv_argb8888_blend_normal_to_argb8888_with_opa_neon(asm_dsc_t * dsc);
static inline void _lv_argb8888_blend_normal_to_argb8888_with_opa_neon(_lv_draw_sw_blend_image_dsc_t * dsc)
static inline lv_result_t _lv_argb8888_blend_normal_to_argb8888_with_opa_neon(_lv_draw_sw_blend_image_dsc_t * dsc)
{
asm_dsc_t asm_dsc = {
.opa = dsc->opa,
@@ -1092,10 +1145,11 @@ static inline void _lv_argb8888_blend_normal_to_argb8888_with_opa_neon(_lv_draw_
.src_stride = dsc->src_stride
};
lv_argb8888_blend_normal_to_argb8888_with_opa_neon(&asm_dsc);
return LV_RESULT_OK;
}
extern void lv_argb8888_blend_normal_to_argb8888_with_mask_neon(asm_dsc_t * dsc);
static inline void _lv_argb8888_blend_normal_to_argb8888_with_mask_neon(_lv_draw_sw_blend_image_dsc_t * dsc)
static inline lv_result_t _lv_argb8888_blend_normal_to_argb8888_with_mask_neon(_lv_draw_sw_blend_image_dsc_t * dsc)
{
asm_dsc_t asm_dsc = {
.dst_buf = dsc->dest_buf,
@@ -1108,10 +1162,11 @@ static inline void _lv_argb8888_blend_normal_to_argb8888_with_mask_neon(_lv_draw
.mask_stride = dsc->mask_stride
};
lv_argb8888_blend_normal_to_argb8888_with_mask_neon(&asm_dsc);
return LV_RESULT_OK;
}
extern void lv_argb8888_blend_normal_to_argb8888_mix_mask_opa_neon(asm_dsc_t * dsc);
static inline void _lv_argb8888_blend_normal_to_argb8888_mix_mask_opa_neon(_lv_draw_sw_blend_image_dsc_t * dsc)
static inline lv_result_t _lv_argb8888_blend_normal_to_argb8888_mix_mask_opa_neon(_lv_draw_sw_blend_image_dsc_t * dsc)
{
asm_dsc_t asm_dsc = {
.opa = dsc->opa,
@@ -1125,6 +1180,7 @@ static inline void _lv_argb8888_blend_normal_to_argb8888_mix_mask_opa_neon(_lv_d
.mask_stride = dsc->mask_stride
};
lv_argb8888_blend_normal_to_argb8888_mix_mask_opa_neon(&asm_dsc);
return LV_RESULT_OK;
}
/**********************

View File

@@ -35,7 +35,7 @@ static void f_gif_read(gd_GIF * gif, void * buf, size_t len);
static int f_gif_seek(gd_GIF * gif, size_t pos, int k);
static void f_gif_close(gd_GIF * gif);
#if LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_MVE
#if LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_HELIUM
#include "gifdec_mve.h"
#endif

View File

@@ -25,7 +25,7 @@
#define LV_DRAW_SW_ASM_NONE 0
#define LV_DRAW_SW_ASM_NEON 1
#define LV_DRAW_SW_ASM_MVE 2
#define LV_DRAW_SW_ASM_HELIUM 2
#define LV_DRAW_SW_ASM_CUSTOM 255
/* Handle special Kconfig options */
@@ -314,6 +314,15 @@
#endif
#endif
/* Use Arm-2D on Cortex-M based devices. Please only enable it for Helium Powered devices for now */
#ifndef LV_USE_DRAW_ARM2D
#ifdef CONFIG_LV_USE_DRAW_ARM2D
#define LV_USE_DRAW_ARM2D CONFIG_LV_USE_DRAW_ARM2D
#else
#define LV_USE_DRAW_ARM2D 0
#endif
#endif
/* Use NXP's VG-Lite GPU on iMX RTxxx platforms. */
#ifndef LV_USE_DRAW_VGLITE
#ifdef CONFIG_LV_USE_DRAW_VGLITE

View File

@@ -65,6 +65,10 @@
* MACROS
**********************/
#ifndef LV_GLOBAL_INIT
#define LV_GLOBAL_INIT(__GLOBAL_PTR) lv_global_init((lv_global_t *)(__GLOBAL_PTR))
#endif
/**********************
* GLOBAL FUNCTIONS
**********************/
@@ -133,7 +137,7 @@ void lv_init(void)
LV_LOG_INFO("begin");
/*Initialize members of static variable lv_global */
lv_global_init(LV_GLOBAL_DEFAULT());
LV_GLOBAL_INIT(LV_GLOBAL_DEFAULT());
lv_mem_init();