perf: Update to LVGL 8.3 (#3279)
Co-authored-by: Peter Feerick <peter.feerick@gmail.com> Co-authored-by: philmoz <phil.a.mitchell@gmail.com>
@@ -14,4 +14,4 @@
|
||||
[submodule "radio/src/thirdparty/libopenui/thirdparty/lvgl"]
|
||||
path = radio/src/thirdparty/libopenui/thirdparty/lvgl
|
||||
url = https://github.com/EdgeTX/lvgl.git
|
||||
branch = release/v8.2
|
||||
branch = v8.3-patched
|
||||
|
||||
@@ -52,7 +52,6 @@ static lv_theme_t theme;
|
||||
#define LV_STYLE_CONST_SINGLE_INIT(var_name, prop, value) \
|
||||
const lv_style_t var_name = {.v_p = {.value1 = {.num = value}}, \
|
||||
.prop1 = prop, \
|
||||
.is_const = 0, \
|
||||
.has_group = 1 << ((prop & 0x1FF) >> 4), \
|
||||
.prop_cnt = 1}
|
||||
|
||||
@@ -60,10 +59,9 @@ static lv_theme_t theme;
|
||||
// Copied from lv_style.h and modified to compile with ARM GCC C++
|
||||
#define LV_STYLE_CONST_MULTI_INIT(var_name, prop_array) \
|
||||
const lv_style_t var_name = {.v_p = {.const_props = prop_array}, \
|
||||
.prop1 = 0, \
|
||||
.is_const = 1, \
|
||||
.prop1 = LV_STYLE_PROP_ANY, \
|
||||
.has_group = 0xFF, \
|
||||
.prop_cnt = 0}
|
||||
.prop_cnt = (sizeof(prop_array) / sizeof((prop_array)[0]))}
|
||||
|
||||
// Opacity
|
||||
LV_STYLE_CONST_SINGLE_INIT(bg_opacity_transparent, LV_STYLE_BG_OPA,
|
||||
@@ -286,33 +284,41 @@ class EdgeTxStyles
|
||||
lv_style_t font_std;
|
||||
lv_style_t font_bold;
|
||||
|
||||
EdgeTxStyles()
|
||||
EdgeTxStyles() {}
|
||||
|
||||
void init()
|
||||
{
|
||||
// Colors
|
||||
for (int i = DEFAULT_COLOR_INDEX; i < LCD_COLOR_COUNT; i += 1) {
|
||||
lv_style_init(&bg_color[i]);
|
||||
lv_style_init(&txt_color[i]);
|
||||
if (!initDone) {
|
||||
initDone = true;
|
||||
|
||||
// Colors
|
||||
for (int i = DEFAULT_COLOR_INDEX; i < LCD_COLOR_COUNT; i += 1) {
|
||||
lv_style_init(&bg_color[i]);
|
||||
lv_style_init(&txt_color[i]);
|
||||
}
|
||||
lv_style_init(&border_color_secondary1);
|
||||
lv_style_init(&border_color_secondary2);
|
||||
lv_style_init(&border_color_focus);
|
||||
|
||||
lv_style_init(&bg_color_grey);
|
||||
lv_style_set_bg_color(&bg_color_grey, lv_palette_main(LV_PALETTE_GREY));
|
||||
lv_style_init(&bg_color_white);
|
||||
lv_style_set_bg_color(&bg_color_white, lv_color_white());
|
||||
lv_style_init(&bg_color_black);
|
||||
lv_style_set_bg_color(&bg_color_black, lv_color_black());
|
||||
lv_style_init(&fg_color_black);
|
||||
lv_style_set_text_color(&fg_color_black, lv_color_black());
|
||||
lv_style_init(&border_color_black);
|
||||
lv_style_set_border_color(&border_color_black, lv_color_black());
|
||||
|
||||
// Fonts
|
||||
lv_style_init(&font_std);
|
||||
lv_style_set_text_font(&font_std, getFont(FONT(STD)));
|
||||
lv_style_init(&font_bold);
|
||||
lv_style_set_text_font(&font_bold, getFont(FONT(BOLD)));
|
||||
|
||||
applyColors();
|
||||
}
|
||||
lv_style_init(&border_color_secondary1);
|
||||
lv_style_init(&border_color_secondary2);
|
||||
lv_style_init(&border_color_focus);
|
||||
|
||||
lv_style_init(&bg_color_grey);
|
||||
lv_style_set_bg_color(&bg_color_grey, lv_palette_main(LV_PALETTE_GREY));
|
||||
lv_style_init(&bg_color_white);
|
||||
lv_style_set_bg_color(&bg_color_white, lv_color_white());
|
||||
lv_style_init(&bg_color_black);
|
||||
lv_style_set_bg_color(&bg_color_black, lv_color_black());
|
||||
lv_style_init(&fg_color_black);
|
||||
lv_style_set_text_color(&fg_color_black, lv_color_black());
|
||||
lv_style_init(&border_color_black);
|
||||
lv_style_set_border_color(&border_color_black, lv_color_black());
|
||||
|
||||
// Fonts
|
||||
lv_style_init(&font_std);
|
||||
lv_style_set_text_font(&font_std, getFont(FONT(STD)));
|
||||
lv_style_init(&font_bold);
|
||||
lv_style_set_text_font(&font_bold, getFont(FONT(BOLD)));
|
||||
}
|
||||
|
||||
void applyColors()
|
||||
@@ -334,11 +340,12 @@ class EdgeTxStyles
|
||||
}
|
||||
|
||||
protected:
|
||||
bool initDone = false;
|
||||
};
|
||||
|
||||
static EdgeTxStyles* styles;
|
||||
static EdgeTxStyles mainStyles;
|
||||
static EdgeTxStyles* previewStyles;
|
||||
static EdgeTxStyles* mainStyles;
|
||||
static EdgeTxStyles* styles = &mainStyles;
|
||||
|
||||
/**********************
|
||||
* GLOBAL FUNCTIONS
|
||||
@@ -355,11 +362,7 @@ lv_theme_t* etx_lv_theme_init(lv_disp_t* disp, lv_color_t color_primary,
|
||||
theme.font_large = font;
|
||||
theme.flags = 0;
|
||||
|
||||
if (!styles) {
|
||||
styles = new EdgeTxStyles();
|
||||
mainStyles = styles;
|
||||
}
|
||||
styles->applyColors();
|
||||
styles->init();
|
||||
|
||||
if (disp == NULL || lv_disp_get_theme(disp) == &theme)
|
||||
lv_obj_report_style_change(NULL);
|
||||
@@ -374,7 +377,7 @@ void usePreviewStyle()
|
||||
styles->applyColors();
|
||||
}
|
||||
|
||||
void useMainStyle() { styles = mainStyles; }
|
||||
void useMainStyle() { styles = &mainStyles; }
|
||||
|
||||
/**********************
|
||||
* Custom object creation
|
||||
@@ -569,8 +572,7 @@ void etx_switch_constructor(const lv_obj_class_t* class_p, lv_obj_t* obj)
|
||||
|
||||
void etx_slider_constructor(const lv_obj_class_t* class_p, lv_obj_t* obj)
|
||||
{
|
||||
etx_add_colors_and_opacity(obj, LV_PART_MAIN,
|
||||
COLOR_THEME_SECONDARY1_INDEX,
|
||||
etx_add_colors_and_opacity(obj, LV_PART_MAIN, COLOR_THEME_SECONDARY1_INDEX,
|
||||
COLOR_THEME_PRIMARY2_INDEX);
|
||||
lv_obj_add_style(obj, (lv_style_t*)&circle, LV_PART_MAIN);
|
||||
lv_obj_add_style(obj, &styles->bg_color[COLOR_THEME_FOCUS_INDEX],
|
||||
@@ -586,7 +588,8 @@ void etx_slider_constructor(const lv_obj_class_t* class_p, lv_obj_t* obj)
|
||||
lv_obj_add_style(obj, (lv_style_t*)&bg_opacity_cover, LV_PART_KNOB);
|
||||
lv_obj_add_style(obj, (lv_style_t*)&slider_knob, LV_PART_KNOB);
|
||||
lv_obj_add_style(obj, &styles->border_color_secondary1, LV_PART_KNOB);
|
||||
lv_obj_add_style(obj, &styles->border_color_focus, LV_PART_KNOB | LV_STATE_FOCUSED);
|
||||
lv_obj_add_style(obj, &styles->border_color_focus,
|
||||
LV_PART_KNOB | LV_STATE_FOCUSED);
|
||||
}
|
||||
|
||||
void etx_btnmatrix_constructor(const lv_obj_class_t* class_p, lv_obj_t* obj)
|
||||
|
||||
@@ -29,9 +29,9 @@
|
||||
/*Swap the 2 bytes of RGB565 color. Useful if the display has an 8-bit interface (e.g. SPI)*/
|
||||
#define LV_COLOR_16_SWAP 0
|
||||
|
||||
/*Enable more complex drawing routines to manage screens transparency.
|
||||
*Can be used if the UI is above another layer, e.g. an OSD menu or video player.
|
||||
*Requires `LV_COLOR_DEPTH = 32` colors and the screen's `bg_opa` should be set to non LV_OPA_COVER value*/
|
||||
/*Enable features to draw on transparent background.
|
||||
*It's required if opa, and transform_* style properties are used.
|
||||
*Can be also used if the UI is above another layer, e.g. an OSD menu or video player.*/
|
||||
#define LV_COLOR_SCREEN_TRANSP 0
|
||||
|
||||
/* Adjust color mix functions rounding. GPUs might calculate color mix (blending) differently.
|
||||
@@ -49,14 +49,14 @@
|
||||
#define LV_MEM_CUSTOM 1
|
||||
#if LV_MEM_CUSTOM == 0
|
||||
/*Size of the memory available for `lv_mem_alloc()` in bytes (>= 2kB)*/
|
||||
#define LV_MEM_SIZE (8U * 1024U) /*[bytes]*/
|
||||
#define LV_MEM_SIZE (48U * 1024U) /*[bytes]*/
|
||||
|
||||
/*Set an address for the memory pool instead of allocating it as a normal array. Can be in external SRAM too.*/
|
||||
#define LV_MEM_ADR 0 /*0: unused*/
|
||||
/*Instead of an address give a memory allocator that will be called to get a memory pool for LVGL. E.g. my_malloc*/
|
||||
#if LV_MEM_ADR == 0
|
||||
//#define LV_MEM_POOL_INCLUDE your_alloc_library /* Uncomment if using an external allocator*/
|
||||
//#define LV_MEM_POOL_ALLOC your_alloc /* Uncomment if using an external allocator*/
|
||||
#undef LV_MEM_POOL_INCLUDE
|
||||
#undef LV_MEM_POOL_ALLOC
|
||||
#endif
|
||||
|
||||
#else /*LV_MEM_CUSTOM*/
|
||||
@@ -89,6 +89,9 @@
|
||||
#if LV_TICK_CUSTOM
|
||||
#define LV_TICK_CUSTOM_INCLUDE "Arduino.h" /*Header for the system time function*/
|
||||
#define LV_TICK_CUSTOM_SYS_TIME_EXPR (millis()) /*Expression evaluating to current system time in ms*/
|
||||
/*If using lvgl as ESP32 component*/
|
||||
// #define LV_TICK_CUSTOM_INCLUDE "esp_timer.h"
|
||||
// #define LV_TICK_CUSTOM_SYS_TIME_EXPR ((esp_timer_get_time() / 1000LL))
|
||||
#endif /*LV_TICK_CUSTOM*/
|
||||
|
||||
/*Default Dot Per Inch. Used to initialize default sizes such as widgets sized, style paddings.
|
||||
@@ -126,33 +129,49 @@
|
||||
#define LV_CIRCLE_CACHE_SIZE 4
|
||||
#endif /*LV_DRAW_COMPLEX*/
|
||||
|
||||
/**
|
||||
* "Simple layers" are used when a widget has `style_opa < 255` to buffer the widget into a layer
|
||||
* and blend it as an image with the given opacity.
|
||||
* Note that `bg_opa`, `text_opa` etc don't require buffering into layer)
|
||||
* The widget can be buffered in smaller chunks to avoid using large buffers.
|
||||
*
|
||||
* - LV_LAYER_SIMPLE_BUF_SIZE: [bytes] the optimal target buffer size. LVGL will try to allocate it
|
||||
* - LV_LAYER_SIMPLE_FALLBACK_BUF_SIZE: [bytes] used if `LV_LAYER_SIMPLE_BUF_SIZE` couldn't be allocated.
|
||||
*
|
||||
* Both buffer sizes are in bytes.
|
||||
* "Transformed layers" (where transform_angle/zoom properties are used) use larger buffers
|
||||
* and can't be drawn in chunks. So these settings affects only widgets with opacity.
|
||||
*/
|
||||
#define LV_LAYER_SIMPLE_BUF_SIZE (24 * 1024)
|
||||
#define LV_LAYER_SIMPLE_FALLBACK_BUF_SIZE (3 * 1024)
|
||||
|
||||
/*Default image cache size. Image caching keeps the images opened.
|
||||
*If only the built-in image formats are used there is no real advantage of caching. (I.e. if no new image decoder is added)
|
||||
*With complex image decoders (e.g. PNG or JPG) caching can save the continuous open/decode of images.
|
||||
*However the opened images might consume additional RAM.
|
||||
*0: to disable caching*/
|
||||
#define LV_IMG_CACHE_DEF_SIZE 0
|
||||
#define LV_IMG_CACHE_DEF_SIZE 0
|
||||
|
||||
/*Number of stops allowed per gradient. Increase this to allow more stops.
|
||||
*This adds (sizeof(lv_color_t) + 1) bytes per additional stop*/
|
||||
#define LV_GRADIENT_MAX_STOPS 2
|
||||
#define LV_GRADIENT_MAX_STOPS 2
|
||||
|
||||
/*Default gradient buffer size.
|
||||
*When LVGL calculates the gradient "maps" it can save them into a cache to avoid calculating them again.
|
||||
*LV_GRAD_CACHE_DEF_SIZE sets the size of this cache in bytes.
|
||||
*If the cache is too small the map will be allocated only while it's required for the drawing.
|
||||
*0 mean no caching.*/
|
||||
#define LV_GRAD_CACHE_DEF_SIZE 0
|
||||
#define LV_GRAD_CACHE_DEF_SIZE 0
|
||||
|
||||
/*Allow dithering the gradients (to achieve visual smooth color gradients on limited color depth display)
|
||||
*LV_DITHER_GRADIENT implies allocating one or two more lines of the object's rendering surface
|
||||
*The increase in memory consumption is (32 bits * object width) plus 24 bits * object width if using error diffusion */
|
||||
#define LV_DITHER_GRADIENT 0
|
||||
#define LV_DITHER_GRADIENT 0
|
||||
#if LV_DITHER_GRADIENT
|
||||
/*Add support for error diffusion dithering.
|
||||
*Error diffusion dithering gets a much better visual result, but implies more CPU consumption and memory when drawing.
|
||||
*The increase in memory consumption is (24 bits * object's width)*/
|
||||
#define LV_DITHER_ERROR_DIFFUSION 0
|
||||
#define LV_DITHER_ERROR_DIFFUSION 0
|
||||
#endif
|
||||
|
||||
/*Maximum buffer size to allocate for rotation.
|
||||
@@ -163,6 +182,9 @@
|
||||
* GPU
|
||||
*-----------*/
|
||||
|
||||
/*Use Arm's 2D acceleration library Arm-2D */
|
||||
#define LV_USE_GPU_ARM2D 0
|
||||
|
||||
/*Use STM32's DMA2D (aka Chrom Art) GPU*/
|
||||
#if defined(SIMU)
|
||||
#define LV_USE_GPU_STM32_DMA2D 0
|
||||
@@ -172,7 +194,7 @@
|
||||
#if LV_USE_GPU_STM32_DMA2D
|
||||
/*Must be defined to include path of CMSIS header of target processor
|
||||
e.g. "stm32f769xx.h" or "stm32f429xx.h"*/
|
||||
#define LV_GPU_DMA2D_CMSIS_INCLUDE "stm32f4xx.h"
|
||||
#define LV_GPU_DMA2D_CMSIS_INCLUDE "thirdparty/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h"
|
||||
#if !defined(DMA2D_NLR_PL_Pos)
|
||||
#define DMA2D_NLR_PL_Pos 16
|
||||
#endif
|
||||
@@ -190,6 +212,11 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*Use SWM341's DMA2D GPU*/
|
||||
#define LV_USE_GPU_SWM341_DMA2D 0
|
||||
#if LV_USE_GPU_SWM341_DMA2D
|
||||
#define LV_GPU_SWM341_DMA2D_INCLUDE "SWM341.h"
|
||||
#endif
|
||||
/*Use NXP's PXP GPU iMX RTxxx platforms*/
|
||||
#define LV_USE_GPU_NXP_PXP 0
|
||||
#if LV_USE_GPU_NXP_PXP
|
||||
@@ -492,6 +519,9 @@
|
||||
#define LV_FONT_SUBPX_BGR 0 /*0: RGB; 1:BGR order*/
|
||||
#endif
|
||||
|
||||
/*Enable drawing placeholders when glyph dsc is not found*/
|
||||
#define LV_USE_FONT_PLACEHOLDER 1
|
||||
|
||||
/*=================
|
||||
* TEXT SETTINGS
|
||||
*=================*/
|
||||
@@ -726,7 +756,7 @@
|
||||
#if LV_USE_FS_STDIO
|
||||
#define LV_FS_STDIO_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/
|
||||
#define LV_FS_STDIO_PATH "" /*Set the working directory. File/directory paths will be appended to it.*/
|
||||
#define LV_FS_STDIO_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/
|
||||
#define LV_FS_STDIO_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/
|
||||
#endif
|
||||
|
||||
/*API for open, read, etc*/
|
||||
@@ -734,13 +764,13 @@
|
||||
#if LV_USE_FS_POSIX
|
||||
#define LV_FS_POSIX_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/
|
||||
#define LV_FS_POSIX_PATH "" /*Set the working directory. File/directory paths will be appended to it.*/
|
||||
#define LV_FS_POSIX_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/
|
||||
#define LV_FS_POSIX_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/
|
||||
#endif
|
||||
|
||||
/*API for CreateFile, ReadFile, etc*/
|
||||
#define LV_USE_FS_WIN32 0
|
||||
#if LV_USE_FS_WIN32
|
||||
#define LV_FS_WIN32_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/
|
||||
#define LV_FS_WIN32_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/
|
||||
#define LV_FS_WIN32_PATH "" /*Set the working directory. File/directory paths will be appended to it.*/
|
||||
#define LV_FS_WIN32_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/
|
||||
#endif
|
||||
@@ -802,10 +832,10 @@
|
||||
|
||||
/*FFmpeg library for image decoding and playing videos
|
||||
*Supports all major image formats so do not enable other image decoder with it*/
|
||||
#define LV_USE_FFMPEG 0
|
||||
#define LV_USE_FFMPEG 0
|
||||
#if LV_USE_FFMPEG
|
||||
/*Dump input information to stderr*/
|
||||
#define LV_FFMPEG_AV_DUMP_FORMAT 0
|
||||
#define LV_FFMPEG_DUMP_FORMAT 0
|
||||
#endif
|
||||
|
||||
/*-----------
|
||||
@@ -821,6 +851,33 @@
|
||||
/*1: Enable grid navigation*/
|
||||
#define LV_USE_GRIDNAV 0
|
||||
|
||||
/*1: Enable lv_obj fragment*/
|
||||
#define LV_USE_FRAGMENT 0
|
||||
|
||||
/*1: Support using images as font in label or span widgets */
|
||||
#define LV_USE_IMGFONT 0
|
||||
|
||||
/*1: Enable a published subscriber based messaging system */
|
||||
#define LV_USE_MSG 0
|
||||
|
||||
/*1: Enable Pinyin input method*/
|
||||
/*Requires: lv_keyboard*/
|
||||
#define LV_USE_IME_PINYIN 0
|
||||
#if LV_USE_IME_PINYIN
|
||||
/*1: Use default thesaurus*/
|
||||
/*If you do not use the default thesaurus, be sure to use `lv_ime_pinyin` after setting the thesauruss*/
|
||||
#define LV_IME_PINYIN_USE_DEFAULT_DICT 1
|
||||
/*Set the maximum number of candidate panels that can be displayed*/
|
||||
/*This needs to be adjusted according to the size of the screen*/
|
||||
#define LV_IME_PINYIN_CAND_TEXT_NUM 6
|
||||
|
||||
/*Use 9 key input(k9)*/
|
||||
#define LV_IME_PINYIN_USE_K9_MODE 1
|
||||
#if LV_IME_PINYIN_USE_K9_MODE == 1
|
||||
#define LV_IME_PINYIN_K9_CAND_TEXT_NUM 3
|
||||
#endif // LV_IME_PINYIN_USE_K9_MODE
|
||||
#endif
|
||||
|
||||
/*==================
|
||||
* EXAMPLES
|
||||
*==================*/
|
||||
@@ -833,28 +890,32 @@
|
||||
====================*/
|
||||
|
||||
/*Show some widget. It might be required to increase `LV_MEM_SIZE` */
|
||||
#define LV_USE_DEMO_WIDGETS 0
|
||||
#define LV_USE_DEMO_WIDGETS 0
|
||||
#if LV_USE_DEMO_WIDGETS
|
||||
#define LV_DEMO_WIDGETS_SLIDESHOW 0
|
||||
#define LV_DEMO_WIDGETS_SLIDESHOW 0
|
||||
#endif
|
||||
|
||||
/*Demonstrate the usage of encoder and keyboard*/
|
||||
#define LV_USE_DEMO_KEYPAD_AND_ENCODER 0
|
||||
#define LV_USE_DEMO_KEYPAD_AND_ENCODER 0
|
||||
|
||||
/*Benchmark your system*/
|
||||
#define LV_USE_DEMO_BENCHMARK 0
|
||||
#define LV_USE_DEMO_BENCHMARK 0
|
||||
#if LV_USE_DEMO_BENCHMARK
|
||||
/*Use RGB565A8 images with 16 bit color depth instead of ARGB8565*/
|
||||
#define LV_DEMO_BENCHMARK_RGB565A8 0
|
||||
#endif
|
||||
|
||||
/*Stress test for LVGL*/
|
||||
#define LV_USE_DEMO_STRESS 0
|
||||
#define LV_USE_DEMO_STRESS 0
|
||||
|
||||
/*Music player demo*/
|
||||
#define LV_USE_DEMO_MUSIC 0
|
||||
#define LV_USE_DEMO_MUSIC 0
|
||||
#if LV_USE_DEMO_MUSIC
|
||||
# define LV_DEMO_MUSIC_SQUARE 0
|
||||
# define LV_DEMO_MUSIC_LANDSCAPE 0
|
||||
# define LV_DEMO_MUSIC_ROUND 0
|
||||
# define LV_DEMO_MUSIC_LARGE 0
|
||||
# define LV_DEMO_MUSIC_AUTO_PLAY 0
|
||||
#define LV_DEMO_MUSIC_SQUARE 0
|
||||
#define LV_DEMO_MUSIC_LANDSCAPE 0
|
||||
#define LV_DEMO_MUSIC_ROUND 0
|
||||
#define LV_DEMO_MUSIC_LARGE 0
|
||||
#define LV_DEMO_MUSIC_AUTO_PLAY 0
|
||||
#endif
|
||||
|
||||
/*--END OF LV_CONF_H--*/
|
||||
|
||||
@@ -68,11 +68,9 @@ static void _copy_rotate_180(uint16_t* dst, uint16_t* src, const rect_t& copy_ar
|
||||
coord_t x1 = LCD_W - copy_area.w - copy_area.x;
|
||||
coord_t y1 = LCD_H - copy_area.h - copy_area.y;
|
||||
|
||||
auto total = copy_area.w * copy_area.h;
|
||||
uint16_t* px_src = src + total - 2;
|
||||
src += copy_area.w - 2;
|
||||
dst += (y1 + copy_area.h - 1) * LCD_W + x1;
|
||||
|
||||
dst += y1 * LCD_W + x1;
|
||||
|
||||
for (auto line = 0; line < copy_area.h; line++) {
|
||||
|
||||
// invert line into _line_buffer first (SRAM)
|
||||
@@ -80,27 +78,26 @@ static void _copy_rotate_180(uint16_t* dst, uint16_t* src, const rect_t& copy_ar
|
||||
|
||||
auto line_end = px_dst + (copy_area.w & ~1);
|
||||
while (px_dst != line_end) {
|
||||
uint32_t* px2_src = (uint32_t*)px_src;
|
||||
uint32_t* px2_dst = (uint32_t*)px_dst;
|
||||
uint32_t* px2_src = (uint32_t*)src;
|
||||
|
||||
uint32_t px = ((*px2_src & 0xFFFF0000) >> 16) | ((*px2_src & 0xFFFF) << 16);
|
||||
*px2_dst = px;
|
||||
*((uint32_t*)px_dst) = ((*px2_src & 0xFFFF0000) >> 16) | ((*px2_src & 0xFFFF) << 16);
|
||||
|
||||
px_src -= 2;
|
||||
src -= 2;
|
||||
px_dst += 2;
|
||||
}
|
||||
|
||||
if (copy_area.w & 1) {
|
||||
*px_dst = *(px_src+1);
|
||||
px_src--;
|
||||
*px_dst = *(src+1);
|
||||
src--;
|
||||
}
|
||||
|
||||
// ... and DMA back into SDRAM
|
||||
DMACopyBitmap(dst, copy_area.w, 1, 0, 0,
|
||||
_line_buffer, copy_area.w, 1, 0, 0,
|
||||
copy_area.w, 1);
|
||||
|
||||
dst += LCD_W;
|
||||
|
||||
src += copy_area.w * 2;
|
||||
dst -= LCD_W;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 9.7 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 9.9 KiB |
|
Before Width: | Height: | Size: 9.5 KiB After Width: | Height: | Size: 9.3 KiB |
|
Before Width: | Height: | Size: 9.3 KiB |
|
Before Width: | Height: | Size: 9.6 KiB After Width: | Height: | Size: 9.5 KiB |
|
Before Width: | Height: | Size: 9.1 KiB After Width: | Height: | Size: 9.0 KiB |
@@ -20,6 +20,7 @@ set(LVGL_SOURCES_MINIMAL
|
||||
draw/sw/lv_draw_sw_gradient.c
|
||||
draw/sw/lv_draw_sw.c
|
||||
draw/sw/lv_draw_sw_blend.c
|
||||
draw/sw/lv_draw_sw_layer.c
|
||||
draw/sw/lv_draw_sw_letter.c
|
||||
draw/sw/lv_draw_sw_arc.c
|
||||
draw/sw/lv_draw_sw_polygon.c
|
||||
@@ -27,7 +28,10 @@ set(LVGL_SOURCES_MINIMAL
|
||||
draw/sw/lv_draw_sw_line.c
|
||||
draw/sw/lv_draw_sw_dither.c
|
||||
draw/sw/lv_draw_sw_rect.c
|
||||
draw/sw/lv_draw_sw_transform.c
|
||||
draw/lv_draw_layer.c
|
||||
draw/lv_draw_line.c
|
||||
draw/lv_draw_transform.c
|
||||
draw/lv_draw.c
|
||||
draw/lv_img_buf.c
|
||||
draw/lv_draw_rect.c
|
||||
|
||||