diff --git a/demos/lv_demos.h b/demos/lv_demos.h
index 9d45e6324c88..63f34dfc72fd 100644
--- a/demos/lv_demos.h
+++ b/demos/lv_demos.h
@@ -51,6 +51,10 @@ extern "C" {
#include "multilang/lv_demo_multilang.h"
#endif
+#if LV_USE_DEMO_RENDER
+#include "render/lv_demo_render.h"
+#endif
+
/*********************
* DEFINES
*********************/
diff --git a/demos/render/README.md b/demos/render/README.md
new file mode 100644
index 000000000000..6518490edee1
--- /dev/null
+++ b/demos/render/README.md
@@ -0,0 +1,48 @@
+# Benchmark demo
+
+
+![LVGL benchmark running](screenshot1.png)
+
+## Overview
+
+The benchmark demo tests the performance in various cases.
+For example rectangle, border, shadow, text, image blending, image transformation, blending modes, etc.
+All tests are repeated with 50% opacity.
+
+The size and position of the objects during testing are set with a pseudo random number to make the benchmark repeatable.
+
+On to top of the screen the title of the current test step, and the result of the previous step is displayed.
+
+## Run the benchmark
+- In `lv_conf.h` or equivalent places set `LV_USE_DEMO_BENCHMARK 1`
+- After `lv_init()` and initializing the drivers and call `lv_demo_benchmark(mode)`
+- If you only want to run a specific scene for any purpose (e.g. debug, performance optimization etc.), you can call `lv_demo_benchmark_run_scene(mode, scene_idx)` instead of `lv_demo_benchmark()`and pass the scene number.
+- If you enabled trace output by setting macro `LV_USE_LOG` to `1` and trace level `LV_LOG_LEVEL` to `LV_LOG_LEVEL_USER` or higher, benchmark results are printed out in `csv` format.
+
+
+## Modes
+The `mode` should be passed to `lv_demo_benchmark(mode)` or `lv_demo_benchmark_run_scene(mode, scene_idx)`.
+
+- `LV_DEMO_BENCHMARK_MODE_RENDER_AND_DRIVER` Render the scenes and show them on the display. Measure rendering time but it might contain extra time when LVGL waits for the driver. Run each scenes for a few seconds so the performance can be seen by eye too. As only the rendering time is measured and converted to FPS, really high values (e.g. 1000 FPS) are possible.
+- `LV_DEMO_BENCHMARK_MODE_REAL` Similar to `RENDER_AND_DRIVER` but instead of measuring the rendering time only measure the real FPS of the system. E.g. even if a scene was rendered in 1 ms, but the screen is redrawn only in every 100 ms, the result will be 10 FPS.
+- `LV_DEMO_BENCHMARK_MODE_RENDER_ONLY` Temporarily display the `flush_cb` so the pure rendering time will be measured. The display is not updated during the benchmark, only at the end when the summary table is shown. Renders a given number of frames from each scene and calculate the FPS from them.
+
+
+## Result summary
+In the end, a table is created to display measured FPS values.
+
+On top of the summary screen, the "Weighted FPS" value is shown.
+In this, the result of the more common cases are taken into account with a higher weight.
+
+"Opa. speed" shows the speed of the measurements with opacity compared to full opacity.
+E.g. "Opa. speed = 90%" means that rendering with opacity is 10% slower.
+
+In the first section of the table, "Slow but common cases", those cases are displayed which are considered common but were slower than 20 FPS.
+
+Below this in the "All cases section" all the results are shown. The < 10 FPS results are shown with red, the >= 10 but < 20 FPS values are displayed with orange.
+
+![LVGL benchmark result summary](screenshot2.png)
+
+
+
+**NOTE**: Compared to the past, the use of rotation and zoom(scaling) in GUI applications has become increasingly common. Therefore, starting from LVGL9, we have assigned a higher priority to zoom(scaling) and rotation operations.
diff --git a/demos/render/lv_demo_render.c b/demos/render/lv_demo_render.c
new file mode 100644
index 000000000000..6fcf0ab67230
--- /dev/null
+++ b/demos/render/lv_demo_render.c
@@ -0,0 +1,280 @@
+/**
+ * @file lv_demo_render.c
+ *
+ */
+
+/*********************
+ * INCLUDES
+ *********************/
+#include "lv_demo_render.h"
+
+#if LV_USE_DEMO_RENDER
+#include "../../src/display/lv_display_private.h"
+#include "../../src/core/lv_global.h"
+
+/*********************
+ * DEFINES
+ *********************/
+
+#define COL_CNT 8
+#define ROW_CNT 8
+#define DEF_WIDTH 55
+#define DEF_HEIGHT 30
+
+/**********************
+ * TYPEDEFS
+ **********************/
+
+#define SCENE_TIME_DEF 2000
+
+typedef struct {
+ const char * name;
+ void (*create_cb)(lv_obj_t * parent);
+} scene_dsc_t;
+
+/**********************
+ * STATIC PROTOTYPES
+ **********************/
+
+static void add_to_cell(lv_obj_t * obj, lv_coord_t col, lv_coord_t row);
+
+
+static lv_obj_t * fill_obj_create(lv_obj_t * parent, lv_coord_t col, lv_coord_t row)
+{
+ lv_color_t colors[] = {lv_color_hex3(0x000),
+ lv_color_hex3(0xfff),
+ lv_color_hex3(0xf00),
+ lv_color_hex3(0x0f0),
+ lv_color_hex3(0x00f),
+ lv_color_hex3(0xff0),
+ lv_color_hex3(0x0ff),
+ lv_color_hex3(0xf0f),
+ };
+
+ lv_obj_t * obj = lv_obj_create(parent);
+ lv_obj_remove_style_all(obj);
+ lv_obj_set_style_bg_opa(obj, LV_OPA_COVER, 0);
+ lv_obj_set_style_bg_color(obj, colors[col], 0);
+ lv_obj_set_size(obj, DEF_WIDTH, DEF_HEIGHT);
+ add_to_cell(obj, col, row);
+
+ return obj;
+
+}
+
+static void fill_cb(lv_obj_t * parent)
+{
+
+ uint32_t i;
+ for(i = 0; i < COL_CNT; i++) {
+ fill_obj_create(parent, i, 0);
+ }
+
+ for(i = 0; i < COL_CNT; i++) {
+ lv_obj_t * obj = fill_obj_create(parent, i, 1);
+ lv_obj_set_style_radius(obj, 10, 0);
+ }
+
+ for(i = 0; i < COL_CNT; i++) {
+ lv_obj_t * obj = fill_obj_create(parent, i, 2);
+ lv_obj_set_style_radius(obj, 100, 0);
+ }
+
+ for(i = 0; i < COL_CNT; i++) {
+ lv_obj_t * obj = fill_obj_create(parent, i, 3);
+ lv_obj_set_style_radius(obj, 10, 0);
+ lv_obj_set_style_bg_grad_dir(obj, LV_GRAD_DIR_HOR, 0);
+ lv_obj_set_style_bg_grad_color(obj, lv_color_hex3(0x888), 0);
+ lv_obj_set_style_bg_grad_stop(obj, 200, 0);
+ }
+
+ for(i = 0; i < COL_CNT; i++) {
+ lv_obj_t * obj = fill_obj_create(parent, i, 4);
+ lv_obj_set_style_radius(obj, 10, 0);
+ lv_obj_set_style_bg_grad_dir(obj, LV_GRAD_DIR_VER, 0);
+ lv_obj_set_style_bg_grad_color(obj, lv_color_hex3(0x888), 0);
+ lv_obj_set_style_bg_grad_stop(obj, 200, 0);
+ }
+
+ for(i = 0; i < COL_CNT; i++) {
+
+ lv_obj_t * obj = fill_obj_create(parent, i, 5);
+ lv_obj_set_style_radius(obj, 10, 0);
+ lv_obj_set_style_bg_grad_dir(obj, LV_GRAD_DIR_HOR, 0);
+ lv_obj_set_style_bg_grad_color(obj, lv_color_hex3(0x888), 0);
+ lv_obj_set_style_bg_grad_opa(obj, LV_OPA_TRANSP, 0);
+ lv_obj_set_style_bg_grad_stop(obj, 200, 0);
+ }
+
+ for(i = 0; i < COL_CNT; i++) {
+ lv_obj_t * obj = fill_obj_create(parent, i, 6);
+ lv_obj_set_style_radius(obj, 10, 0);
+ lv_obj_set_style_bg_grad_dir(obj, LV_GRAD_DIR_VER, 0);
+ lv_obj_set_style_bg_grad_color(obj, lv_color_hex3(0x888), 0);
+ lv_obj_set_style_bg_grad_opa(obj, LV_OPA_TRANSP, 0);
+ lv_obj_set_style_bg_grad_stop(obj, 200, 0);
+ }
+}
+
+static lv_obj_t * border_obj_create(lv_obj_t * parent, lv_coord_t col, lv_coord_t row)
+{
+
+ lv_obj_t * obj = lv_obj_create(parent);
+ lv_obj_remove_style_all(obj);
+ lv_obj_set_style_border_color(obj, lv_color_hex3(0x000), 0);
+ lv_obj_set_style_border_width(obj, 3, 0);
+ lv_obj_set_size(obj, DEF_WIDTH, DEF_HEIGHT);
+ add_to_cell(obj, col, row);
+
+ return obj;
+
+}
+
+static void border_cb(lv_obj_t * parent)
+{
+ lv_border_side_t sides[] = {
+ LV_BORDER_SIDE_NONE,
+ LV_BORDER_SIDE_FULL,
+ LV_BORDER_SIDE_LEFT,
+ LV_BORDER_SIDE_RIGHT,
+ LV_BORDER_SIDE_TOP,
+ LV_BORDER_SIDE_BOTTOM,
+ LV_BORDER_SIDE_TOP | LV_BORDER_SIDE_RIGHT,
+ LV_BORDER_SIDE_RIGHT | LV_BORDER_SIDE_BOTTOM,
+ LV_BORDER_SIDE_LEFT| LV_BORDER_SIDE_BOTTOM,
+ LV_BORDER_SIDE_LEFT | LV_BORDER_SIDE_TOP,
+ LV_BORDER_SIDE_LEFT | LV_BORDER_SIDE_RIGHT,
+ LV_BORDER_SIDE_TOP | LV_BORDER_SIDE_BOTTOM,
+ LV_BORDER_SIDE_LEFT | LV_BORDER_SIDE_RIGHT | LV_BORDER_SIDE_BOTTOM,
+ LV_BORDER_SIDE_LEFT | LV_BORDER_SIDE_BOTTOM | LV_BORDER_SIDE_TOP,
+ LV_BORDER_SIDE_LEFT | LV_BORDER_SIDE_RIGHT | LV_BORDER_SIDE_TOP,
+ LV_BORDER_SIDE_BOTTOM | LV_BORDER_SIDE_RIGHT | LV_BORDER_SIDE_TOP,
+ };
+
+ uint32_t i;
+ for(i = 0; i < COL_CNT; i++) {
+ lv_obj_t * obj = border_obj_create(parent, i, 0);
+ lv_obj_set_style_radius(obj, 0, 0);
+ lv_obj_set_style_border_side(obj, sides[i], 0);
+ lv_obj_set_style_border_color(obj, lv_color_hex3(0xf00), 0);
+ }
+
+ for(i = 0; i < COL_CNT; i++) {
+ lv_obj_t * obj = border_obj_create(parent, i, 1);
+ lv_obj_set_style_radius(obj, 0, 0);
+ lv_obj_set_style_border_side(obj, sides[i + 8], 0);
+ lv_obj_set_style_border_color(obj, lv_color_hex3(0xf00), 0);
+ }
+
+ for(i = 0; i < COL_CNT; i++) {
+ lv_obj_t * obj = border_obj_create(parent, i, 2);
+ lv_obj_set_style_radius(obj, 10, 0);
+ lv_obj_set_style_border_side(obj, sides[i], 0);
+ lv_obj_set_style_border_color(obj, lv_color_hex3(0x0f0), 0);
+ }
+
+ for(i = 0; i < COL_CNT; i++) {
+ lv_obj_t * obj = border_obj_create(parent, i, 3);
+ lv_obj_set_style_radius(obj, 10, 0);
+ lv_obj_set_style_border_side(obj, sides[i + 8], 0);
+ lv_obj_set_style_border_color(obj, lv_color_hex3(0x0f0), 0);
+ }
+
+ for(i = 0; i < COL_CNT; i++) {
+ lv_obj_t * obj = border_obj_create(parent, i, 4);
+ lv_obj_set_style_radius(obj, 100, 0);
+ lv_obj_set_style_border_side(obj, sides[i], 0);
+ lv_obj_set_style_border_color(obj, lv_color_hex3(0x00f), 0);
+ }
+
+ for(i = 0; i < COL_CNT; i++) {
+ lv_obj_t * obj = border_obj_create(parent, i, 5);
+ lv_obj_set_style_radius(obj, 100, 0);
+ lv_obj_set_style_border_side(obj, sides[i + 8], 0);
+ lv_obj_set_style_border_color(obj, lv_color_hex3(0x00f), 0);
+ }
+
+ for(i = 0; i < COL_CNT; i++) {
+ lv_obj_t * obj = border_obj_create(parent, i, 6);
+ lv_obj_set_style_radius(obj, 100, 0);
+ lv_obj_set_style_border_side(obj, sides[i], 0);
+ lv_obj_set_style_border_color(obj, lv_color_hex3(0x888), 0);
+ lv_obj_set_style_border_width(obj, 10, 0);
+ }
+
+ for(i = 0; i < COL_CNT; i++) {
+ lv_obj_t * obj = border_obj_create(parent, i, 7);
+ lv_obj_set_style_radius(obj, 100, 0);
+ lv_obj_set_style_border_side(obj, sides[i + 8], 0);
+ lv_obj_set_style_border_color(obj, lv_color_hex3(0x888), 0);
+ lv_obj_set_style_border_width(obj, 10, 0);
+ }
+}
+
+/**********************
+ * STATIC VARIABLES
+ **********************/
+//fill (radius + gradient too)
+//border (each sides + radius)
+//outline (radius)
+//box shadow (offset, size, spread)
+//text (normal text + underline/strike through, placeholder)
+//triangle (just some rectangles)
+//image (various formats + transformation)
+//line (various angles + line caps)
+//arc (some arcs + caps)
+//vector (later)
+//layer (blend mode, transformation)
+//mask bitmap (not implemented SW render yet)
+//mask rectangle
+
+static scene_dsc_t scenes[] = {
+ {.name = "Fill ", .create_cb = fill_cb},
+ {.name = "Border", .create_cb = border_cb},
+
+ {.name = "", .create_cb = NULL}
+};
+
+/**********************
+ * MACROS
+ **********************/
+
+/**********************
+ * GLOBAL FUNCTIONS
+ **********************/
+
+void lv_demo_render(uint32_t idx)
+{
+
+ lv_obj_t * scr = lv_screen_active();
+ lv_obj_clean(scr);
+ lv_obj_remove_style_all(scr);
+ lv_obj_set_style_bg_opa(scr, LV_OPA_COVER, 0);
+ lv_obj_set_style_text_color(scr, lv_color_black(), 0);
+ lv_obj_set_style_bg_color(scr, lv_color_white(), 0);
+
+ lv_obj_t * main_parent = lv_obj_create(scr);
+ lv_obj_remove_style_all(main_parent);
+ lv_obj_set_style_bg_opa(main_parent, LV_OPA_COVER, 0);
+ lv_obj_set_style_bg_color(main_parent, lv_color_hex3(0xaaf), 0);
+ lv_obj_set_size(main_parent, 480, 272);
+
+ static const lv_coord_t grid_cols[] = {60, 60, 60, 60, 60, 60, 60, 60, LV_GRID_TEMPLATE_LAST};
+ static const lv_coord_t grid_rows[] = {34, 34, 34, 34, 34, 34, 34, 34, LV_GRID_TEMPLATE_LAST};
+ lv_obj_set_grid_dsc_array(main_parent, grid_cols, grid_rows);
+
+
+ if(scenes[idx].create_cb) scenes[idx].create_cb(main_parent);
+}
+
+/**********************
+ * STATIC FUNCTIONS
+ **********************/
+
+static void add_to_cell(lv_obj_t * obj, lv_coord_t col, lv_coord_t row)
+{
+ lv_obj_set_grid_cell(obj, LV_GRID_ALIGN_CENTER, col, 1, LV_GRID_ALIGN_CENTER, row, 1);
+}
+
+
+#endif
diff --git a/demos/render/lv_demo_render.h b/demos/render/lv_demo_render.h
new file mode 100644
index 000000000000..7e63ed68c637
--- /dev/null
+++ b/demos/render/lv_demo_render.h
@@ -0,0 +1,48 @@
+/**
+ * @file lv_demo_render.h
+ *
+ */
+
+#ifndef LV_DEMO_RENDER_H
+#define LV_DEMO_RENDER_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*********************
+ * INCLUDES
+ *********************/
+#include "../lv_demos.h"
+
+#if LV_USE_DEMO_RENDER
+
+/*********************
+ * DEFINES
+ *********************/
+
+/**********************
+ * TYPEDEFS
+ **********************/
+
+/**********************
+ * GLOBAL PROTOTYPES
+ **********************/
+
+/**
+ * Run the render verification for a scenario
+ * @param idx index of the scenario to run
+ */
+void lv_demo_render(uint32_t idx);
+
+/**********************
+ * MACROS
+ **********************/
+
+#endif /*LV_USE_DEMO_RENDER*/
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /*LV_DEMO_RENDER_H*/
diff --git a/demos/render/screenshot1.png b/demos/render/screenshot1.png
new file mode 100644
index 000000000000..845f2be62a21
Binary files /dev/null and b/demos/render/screenshot1.png differ
diff --git a/demos/render/screenshot2.png b/demos/render/screenshot2.png
new file mode 100644
index 000000000000..0a0023b60f64
Binary files /dev/null and b/demos/render/screenshot2.png differ
diff --git a/docs/overview/style-props.md b/docs/overview/style-props.md
index 07eb68022138..15ce2b4427b6 100644
--- a/docs/overview/style-props.md
+++ b/docs/overview/style-props.md
@@ -226,7 +226,7 @@ Sets the padding between the columns. Used by the layouts.
Properties to describe spacing around an object. Very similar to the margin properties in HTML.
### margin_top
-Sets the margin on the top. The object will keep this space from its siblings in layouts.
+Sets the margin on the top. The object will keep this space from its siblings in layouts.
- Default 0
- Inherited No
@@ -318,19 +318,28 @@ Set the point from which the background's gradient color should start. 0 means t
- Ext. draw No
-### bg_grad
-Set the gradient definition. The pointed instance must exist while the object is alive. NULL to disable. It wraps `BG_GRAD_COLOR`, `BG_GRAD_DIR`, `BG_MAIN_STOP` and `BG_GRAD_STOP` into one descriptor and allows creating gradients with more colors too.
+### bg_main_opa
+Set the opacity of the first gradient color
-- Default `NULL`
+- Default 255
+- Inherited No
+- Layout No
+- Ext. draw No
+
+
+### bg_grad_opa
+Set the opacity of the second gradient color
+
+- Default 255
- Inherited No
- Layout No
- Ext. draw No
-### bg_dither_mode
-Set the dithering mode of the gradient of the background. The possible values are `LV_DITHER_NONE/ORDERED/ERR_DIFF`.
+### bg_grad
+Set the gradient definition. The pointed instance must exist while the object is alive. NULL to disable. It wraps `BG_GRAD_COLOR`, `BG_GRAD_DIR`, `BG_MAIN_STOP` and `BG_GRAD_STOP` into one descriptor and allows creating gradients with more colors too. If it's set other gradient related properties will be ignored'
-- Default `LV_DITHER_NONE`
+- Default `NULL`
- Inherited No
- Layout No
- Ext. draw No
@@ -433,7 +442,7 @@ Sets whether the border should be drawn before or after the children are drawn.
Properties to describe the outline. It's like a border but drawn outside of the rectangles.
### outline_width
-Set the width of the outline in pixels.
+Set the width of the outline in pixels.
- Default 0
- Inherited No
@@ -481,7 +490,7 @@ Set the width of the shadow in pixels. The value should be >= 0.
### shadow_ofs_x
-Set an offset on the shadow in pixels in X direction.
+Set an offset on the shadow in pixels in X direction.
- Default 0
- Inherited No
@@ -490,7 +499,7 @@ Set an offset on the shadow in pixels in X direction.
### shadow_ofs_y
-Set an offset on the shadow in pixels in Y direction.
+Set an offset on the shadow in pixels in Y direction.
- Default 0
- Inherited No
@@ -586,7 +595,7 @@ Set the gap between dashes in pixel. Note that dash works only on horizontal and
### line_rounded
-Make the end points of the lines rounded. `true`: rounded, `false`: perpendicular line ending
+Make the end points of the lines rounded. `true`: rounded, `false`: perpendicular line ending
- Default 0
- Inherited No
@@ -625,7 +634,7 @@ Set the width (thickness) of the arcs in pixel.
### arc_rounded
-Make the end points of the arcs rounded. `true`: rounded, `false`: perpendicular line ending
+Make the end points of the arcs rounded. `true`: rounded, `false`: perpendicular line ending
- Default 0
- Inherited No
@@ -682,7 +691,7 @@ Set the opacity of the text. Value 0, `LV_OPA_0` or `LV_OPA_TRANSP` means fully
### text_font
-Set the font of the text (a pointer `lv_font_t *`).
+Set the font of the text (a pointer `lv_font_t *`).
- Default `LV_FONT_DEFAULT`
- Inherited Yes
diff --git a/lv_conf_template.h b/lv_conf_template.h
index ae3e75828db2..c8a5246f020b 100644
--- a/lv_conf_template.h
+++ b/lv_conf_template.h
@@ -810,10 +810,9 @@
/*Benchmark your system*/
#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
+
+/*Render test for each primitives. Requires at least 480x272 display*/
+#define LV_USE_DEMO_RENDER 0
/*Stress test for LVGL*/
#define LV_USE_DEMO_STRESS 0
diff --git a/scripts/style_api_gen.py b/scripts/style_api_gen.py
index 0170563214bc..af6c1660f0f5 100755
--- a/scripts/style_api_gen.py
+++ b/scripts/style_api_gen.py
@@ -145,13 +145,17 @@
'style_type': 'num', 'var_type': 'lv_coord_t', 'default':255, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
'dsc': "Set the point from which the background's gradient color should start. 0 means to top/left side, 255 the bottom/right side, 128 the center, and so on"},
+{'name': 'BG_MAIN_OPA',
+ 'style_type': 'num', 'var_type': 'lv_opa_t', 'default':255, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
+ 'dsc': "Set the opacity of the first gradient color"},
+
+{'name': 'BG_GRAD_OPA',
+ 'style_type': 'num', 'var_type': 'lv_opa_t', 'default':255, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
+ 'dsc': "Set the opacity of the second gradient color"},
+
{'name': 'BG_GRAD',
'style_type': 'ptr', 'var_type': 'const lv_grad_dsc_t *', 'default':'`NULL`', 'inherited': 0, 'layout': 0, 'ext_draw': 0,
- 'dsc': "Set the gradient definition. The pointed instance must exist while the object is alive. NULL to disable. It wraps `BG_GRAD_COLOR`, `BG_GRAD_DIR`, `BG_MAIN_STOP` and `BG_GRAD_STOP` into one descriptor and allows creating gradients with more colors too."},
-
-{'name': 'BG_DITHER_MODE',
- 'style_type': 'num', 'var_type': 'lv_dither_mode_t', 'default':'`LV_DITHER_NONE`', 'inherited': 0, 'layout': 0, 'ext_draw': 0,
- 'dsc': "Set the dithering mode of the gradient of the background. The possible values are `LV_DITHER_NONE/ORDERED/ERR_DIFF`."},
+ 'dsc': "Set the gradient definition. The pointed instance must exist while the object is alive. NULL to disable. It wraps `BG_GRAD_COLOR`, `BG_GRAD_DIR`, `BG_MAIN_STOP` and `BG_GRAD_STOP` into one descriptor and allows creating gradients with more colors too. If it's set other gradient related properties will be ignored'"},
{'name': 'BG_IMAGE_SRC',
'style_type': 'ptr', 'var_type': 'const void *', 'default':'`NULL`', 'inherited': 0, 'layout': 0, 'ext_draw': 1,
diff --git a/src/core/lv_obj_draw.c b/src/core/lv_obj_draw.c
index 3d3a5265d6be..9cc0b11aad63 100644
--- a/src/core/lv_obj_draw.c
+++ b/src/core/lv_obj_draw.c
@@ -71,10 +71,9 @@ void lv_obj_init_draw_rect_dsc(lv_obj_t * obj, uint32_t part, lv_draw_rect_dsc_t
draw_dsc->bg_grad.stops[1].color = lv_obj_get_style_bg_grad_color_filtered(obj, part);
draw_dsc->bg_grad.stops[0].frac = lv_obj_get_style_bg_main_stop(obj, part);
draw_dsc->bg_grad.stops[1].frac = lv_obj_get_style_bg_grad_stop(obj, part);
- draw_dsc->bg_grad.stops[0].opa = 0xFF;
- draw_dsc->bg_grad.stops[1].opa = 0xFF;
+ draw_dsc->bg_grad.stops[0].opa = lv_obj_get_style_bg_main_opa(obj, part);
+ draw_dsc->bg_grad.stops[1].opa = lv_obj_get_style_bg_grad_opa(obj, part);
}
- draw_dsc->bg_grad.dither = lv_obj_get_style_bg_dither_mode(obj, part);
}
}
}
diff --git a/src/core/lv_obj_style.c b/src/core/lv_obj_style.c
index 75ea049ad4c1..8ed6fe94dc6e 100644
--- a/src/core/lv_obj_style.c
+++ b/src/core/lv_obj_style.c
@@ -344,6 +344,8 @@ static inline lv_style_value_t lv_style_prop_get_default_inlined(lv_style_prop_t
case LV_STYLE_BORDER_OPA:
case LV_STYLE_TEXT_OPA:
case LV_STYLE_IMAGE_OPA:
+ case LV_STYLE_BG_GRAD_OPA:
+ case LV_STYLE_BG_MAIN_OPA:
case LV_STYLE_BG_IMAGE_OPA:
case LV_STYLE_OUTLINE_OPA:
case LV_STYLE_SHADOW_OPA:
diff --git a/src/core/lv_obj_style_gen.c b/src/core/lv_obj_style_gen.c
index 4cfc9b874d11..c64f229ad99d 100644
--- a/src/core/lv_obj_style_gen.c
+++ b/src/core/lv_obj_style_gen.c
@@ -282,20 +282,28 @@ void lv_obj_set_style_bg_grad_stop(struct _lv_obj_t * obj, lv_coord_t value, lv_
lv_obj_set_local_style_prop(obj, LV_STYLE_BG_GRAD_STOP, v, selector);
}
-void lv_obj_set_style_bg_grad(struct _lv_obj_t * obj, const lv_grad_dsc_t * value, lv_style_selector_t selector)
+void lv_obj_set_style_bg_main_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
- .ptr = value
+ .num = (int32_t)value
};
- lv_obj_set_local_style_prop(obj, LV_STYLE_BG_GRAD, v, selector);
+ lv_obj_set_local_style_prop(obj, LV_STYLE_BG_MAIN_OPA, v, selector);
}
-void lv_obj_set_style_bg_dither_mode(struct _lv_obj_t * obj, lv_dither_mode_t value, lv_style_selector_t selector)
+void lv_obj_set_style_bg_grad_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.num = (int32_t)value
};
- lv_obj_set_local_style_prop(obj, LV_STYLE_BG_DITHER_MODE, v, selector);
+ lv_obj_set_local_style_prop(obj, LV_STYLE_BG_GRAD_OPA, v, selector);
+}
+
+void lv_obj_set_style_bg_grad(struct _lv_obj_t * obj, const lv_grad_dsc_t * value, lv_style_selector_t selector)
+{
+ lv_style_value_t v = {
+ .ptr = value
+ };
+ lv_obj_set_local_style_prop(obj, LV_STYLE_BG_GRAD, v, selector);
}
void lv_obj_set_style_bg_image_src(struct _lv_obj_t * obj, const void * value, lv_style_selector_t selector)
@@ -658,8 +666,7 @@ void lv_obj_set_style_opa_layered(struct _lv_obj_t * obj, lv_opa_t value, lv_sty
lv_obj_set_local_style_prop(obj, LV_STYLE_OPA_LAYERED, v, selector);
}
-void lv_obj_set_style_color_filter_dsc(struct _lv_obj_t * obj, const lv_color_filter_dsc_t * value,
- lv_style_selector_t selector)
+void lv_obj_set_style_color_filter_dsc(struct _lv_obj_t * obj, const lv_color_filter_dsc_t * value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.ptr = value
@@ -699,8 +706,7 @@ void lv_obj_set_style_anim_speed(struct _lv_obj_t * obj, uint32_t value, lv_styl
lv_obj_set_local_style_prop(obj, LV_STYLE_ANIM_SPEED, v, selector);
}
-void lv_obj_set_style_transition(struct _lv_obj_t * obj, const lv_style_transition_dsc_t * value,
- lv_style_selector_t selector)
+void lv_obj_set_style_transition(struct _lv_obj_t * obj, const lv_style_transition_dsc_t * value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.ptr = value
@@ -772,8 +778,7 @@ void lv_obj_set_style_flex_grow(struct _lv_obj_t * obj, uint8_t value, lv_style_
lv_obj_set_local_style_prop(obj, LV_STYLE_FLEX_GROW, v, selector);
}
-void lv_obj_set_style_grid_column_dsc_array(struct _lv_obj_t * obj, const lv_coord_t * value,
- lv_style_selector_t selector)
+void lv_obj_set_style_grid_column_dsc_array(struct _lv_obj_t * obj, const lv_coord_t * value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.ptr = value
diff --git a/src/core/lv_obj_style_gen.h b/src/core/lv_obj_style_gen.h
index ab46221b08de..281e47d1c935 100644
--- a/src/core/lv_obj_style_gen.h
+++ b/src/core/lv_obj_style_gen.h
@@ -208,8 +208,7 @@ static inline lv_color_t lv_obj_get_style_bg_grad_color(const struct _lv_obj_t *
static inline lv_color_t lv_obj_get_style_bg_grad_color_filtered(const struct _lv_obj_t * obj, uint32_t part)
{
- lv_style_value_t v = _lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part,
- LV_STYLE_BG_GRAD_COLOR));
+ lv_style_value_t v = _lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part, LV_STYLE_BG_GRAD_COLOR));
return v.color;
}
@@ -231,16 +230,22 @@ static inline lv_coord_t lv_obj_get_style_bg_grad_stop(const struct _lv_obj_t *
return (lv_coord_t)v.num;
}
-static inline const lv_grad_dsc_t * lv_obj_get_style_bg_grad(const struct _lv_obj_t * obj, uint32_t part)
+static inline lv_opa_t lv_obj_get_style_bg_main_opa(const struct _lv_obj_t * obj, uint32_t part)
{
- lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_GRAD);
- return (const lv_grad_dsc_t *)v.ptr;
+ lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_MAIN_OPA);
+ return (lv_opa_t)v.num;
}
-static inline lv_dither_mode_t lv_obj_get_style_bg_dither_mode(const struct _lv_obj_t * obj, uint32_t part)
+static inline lv_opa_t lv_obj_get_style_bg_grad_opa(const struct _lv_obj_t * obj, uint32_t part)
{
- lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_DITHER_MODE);
- return (lv_dither_mode_t)v.num;
+ lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_GRAD_OPA);
+ return (lv_opa_t)v.num;
+}
+
+static inline const lv_grad_dsc_t * lv_obj_get_style_bg_grad(const struct _lv_obj_t * obj, uint32_t part)
+{
+ lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_GRAD);
+ return (const lv_grad_dsc_t *)v.ptr;
}
static inline const void * lv_obj_get_style_bg_image_src(const struct _lv_obj_t * obj, uint32_t part)
@@ -263,8 +268,7 @@ static inline lv_color_t lv_obj_get_style_bg_image_recolor(const struct _lv_obj_
static inline lv_color_t lv_obj_get_style_bg_image_recolor_filtered(const struct _lv_obj_t * obj, uint32_t part)
{
- lv_style_value_t v = _lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part,
- LV_STYLE_BG_IMAGE_RECOLOR));
+ lv_style_value_t v = _lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part, LV_STYLE_BG_IMAGE_RECOLOR));
return v.color;
}
@@ -288,8 +292,7 @@ static inline lv_color_t lv_obj_get_style_border_color(const struct _lv_obj_t *
static inline lv_color_t lv_obj_get_style_border_color_filtered(const struct _lv_obj_t * obj, uint32_t part)
{
- lv_style_value_t v = _lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part,
- LV_STYLE_BORDER_COLOR));
+ lv_style_value_t v = _lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part, LV_STYLE_BORDER_COLOR));
return v.color;
}
@@ -331,8 +334,7 @@ static inline lv_color_t lv_obj_get_style_outline_color(const struct _lv_obj_t *
static inline lv_color_t lv_obj_get_style_outline_color_filtered(const struct _lv_obj_t * obj, uint32_t part)
{
- lv_style_value_t v = _lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part,
- LV_STYLE_OUTLINE_COLOR));
+ lv_style_value_t v = _lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part, LV_STYLE_OUTLINE_COLOR));
return v.color;
}
@@ -380,8 +382,7 @@ static inline lv_color_t lv_obj_get_style_shadow_color(const struct _lv_obj_t *
static inline lv_color_t lv_obj_get_style_shadow_color_filtered(const struct _lv_obj_t * obj, uint32_t part)
{
- lv_style_value_t v = _lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part,
- LV_STYLE_SHADOW_COLOR));
+ lv_style_value_t v = _lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part, LV_STYLE_SHADOW_COLOR));
return v.color;
}
@@ -405,8 +406,7 @@ static inline lv_color_t lv_obj_get_style_image_recolor(const struct _lv_obj_t *
static inline lv_color_t lv_obj_get_style_image_recolor_filtered(const struct _lv_obj_t * obj, uint32_t part)
{
- lv_style_value_t v = _lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part,
- LV_STYLE_IMAGE_RECOLOR));
+ lv_style_value_t v = _lv_obj_style_apply_color_filter(obj, part, lv_obj_get_style_prop(obj, part, LV_STYLE_IMAGE_RECOLOR));
return v.color;
}
@@ -566,8 +566,7 @@ static inline lv_opa_t lv_obj_get_style_opa_layered(const struct _lv_obj_t * obj
return (lv_opa_t)v.num;
}
-static inline const lv_color_filter_dsc_t * lv_obj_get_style_color_filter_dsc(const struct _lv_obj_t * obj,
- uint32_t part)
+static inline const lv_color_filter_dsc_t * lv_obj_get_style_color_filter_dsc(const struct _lv_obj_t * obj, uint32_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_COLOR_FILTER_DSC);
return (const lv_color_filter_dsc_t *)v.ptr;
@@ -745,8 +744,9 @@ void lv_obj_set_style_bg_grad_color(struct _lv_obj_t * obj, lv_color_t value, lv
void lv_obj_set_style_bg_grad_dir(struct _lv_obj_t * obj, lv_grad_dir_t value, lv_style_selector_t selector);
void lv_obj_set_style_bg_main_stop(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_bg_grad_stop(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
+void lv_obj_set_style_bg_main_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
+void lv_obj_set_style_bg_grad_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
void lv_obj_set_style_bg_grad(struct _lv_obj_t * obj, const lv_grad_dsc_t * value, lv_style_selector_t selector);
-void lv_obj_set_style_bg_dither_mode(struct _lv_obj_t * obj, lv_dither_mode_t value, lv_style_selector_t selector);
void lv_obj_set_style_bg_image_src(struct _lv_obj_t * obj, const void * value, lv_style_selector_t selector);
void lv_obj_set_style_bg_image_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
void lv_obj_set_style_bg_image_recolor(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector);
@@ -792,14 +792,12 @@ void lv_obj_set_style_radius(struct _lv_obj_t * obj, lv_coord_t value, lv_style_
void lv_obj_set_style_clip_corner(struct _lv_obj_t * obj, bool value, lv_style_selector_t selector);
void lv_obj_set_style_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
void lv_obj_set_style_opa_layered(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
-void lv_obj_set_style_color_filter_dsc(struct _lv_obj_t * obj, const lv_color_filter_dsc_t * value,
- lv_style_selector_t selector);
+void lv_obj_set_style_color_filter_dsc(struct _lv_obj_t * obj, const lv_color_filter_dsc_t * value, lv_style_selector_t selector);
void lv_obj_set_style_color_filter_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
void lv_obj_set_style_anim(struct _lv_obj_t * obj, const lv_anim_t * value, lv_style_selector_t selector);
void lv_obj_set_style_anim_time(struct _lv_obj_t * obj, uint32_t value, lv_style_selector_t selector);
void lv_obj_set_style_anim_speed(struct _lv_obj_t * obj, uint32_t value, lv_style_selector_t selector);
-void lv_obj_set_style_transition(struct _lv_obj_t * obj, const lv_style_transition_dsc_t * value,
- lv_style_selector_t selector);
+void lv_obj_set_style_transition(struct _lv_obj_t * obj, const lv_style_transition_dsc_t * value, lv_style_selector_t selector);
void lv_obj_set_style_blend_mode(struct _lv_obj_t * obj, lv_blend_mode_t value, lv_style_selector_t selector);
void lv_obj_set_style_layout(struct _lv_obj_t * obj, uint16_t value, lv_style_selector_t selector);
void lv_obj_set_style_base_dir(struct _lv_obj_t * obj, lv_base_dir_t value, lv_style_selector_t selector);
@@ -808,11 +806,9 @@ void lv_obj_set_style_flex_main_place(struct _lv_obj_t * obj, lv_flex_align_t va
void lv_obj_set_style_flex_cross_place(struct _lv_obj_t * obj, lv_flex_align_t value, lv_style_selector_t selector);
void lv_obj_set_style_flex_track_place(struct _lv_obj_t * obj, lv_flex_align_t value, lv_style_selector_t selector);
void lv_obj_set_style_flex_grow(struct _lv_obj_t * obj, uint8_t value, lv_style_selector_t selector);
-void lv_obj_set_style_grid_column_dsc_array(struct _lv_obj_t * obj, const lv_coord_t * value,
- lv_style_selector_t selector);
+void lv_obj_set_style_grid_column_dsc_array(struct _lv_obj_t * obj, const lv_coord_t * value, lv_style_selector_t selector);
void lv_obj_set_style_grid_column_align(struct _lv_obj_t * obj, lv_grid_align_t value, lv_style_selector_t selector);
-void lv_obj_set_style_grid_row_dsc_array(struct _lv_obj_t * obj, const lv_coord_t * value,
- lv_style_selector_t selector);
+void lv_obj_set_style_grid_row_dsc_array(struct _lv_obj_t * obj, const lv_coord_t * value, lv_style_selector_t selector);
void lv_obj_set_style_grid_row_align(struct _lv_obj_t * obj, lv_grid_align_t value, lv_style_selector_t selector);
void lv_obj_set_style_grid_cell_column_pos(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_grid_cell_x_align(struct _lv_obj_t * obj, lv_grid_align_t value, lv_style_selector_t selector);
diff --git a/src/lv_conf_internal.h b/src/lv_conf_internal.h
index 5f6a3e81c70d..b93346c8b8c7 100644
--- a/src/lv_conf_internal.h
+++ b/src/lv_conf_internal.h
@@ -2634,14 +2634,13 @@
#define LV_USE_DEMO_BENCHMARK 0
#endif
#endif
-#if LV_USE_DEMO_BENCHMARK
- /*Use RGB565A8 images with 16 bit color depth instead of ARGB8565*/
- #ifndef LV_DEMO_BENCHMARK_RGB565A8
- #ifdef CONFIG_LV_DEMO_BENCHMARK_RGB565A8
- #define LV_DEMO_BENCHMARK_RGB565A8 CONFIG_LV_DEMO_BENCHMARK_RGB565A8
- #else
- #define LV_DEMO_BENCHMARK_RGB565A8 0
- #endif
+
+/*Render test for each primitives. Requires at least 480x272 display*/
+#ifndef LV_USE_DEMO_RENDER
+ #ifdef CONFIG_LV_USE_DEMO_RENDER
+ #define LV_USE_DEMO_RENDER CONFIG_LV_USE_DEMO_RENDER
+ #else
+ #define LV_USE_DEMO_RENDER 0
#endif
#endif
diff --git a/src/misc/lv_style.c b/src/misc/lv_style.c
index 37faf24b0148..2b04d51f0036 100644
--- a/src/misc/lv_style.c
+++ b/src/misc/lv_style.c
@@ -69,8 +69,9 @@ const uint8_t _lv_style_builtin_prop_flag_lookup_table[_LV_STYLE_NUM_BUILT_IN_PR
[LV_STYLE_BG_GRAD_DIR] = 0,
[LV_STYLE_BG_MAIN_STOP] = 0,
[LV_STYLE_BG_GRAD_STOP] = 0,
+ [LV_STYLE_BG_MAIN_OPA] = 0,
+ [LV_STYLE_BG_GRAD_OPA] = 0,
[LV_STYLE_BG_GRAD] = 0,
- [LV_STYLE_BG_DITHER_MODE] = 0,
[LV_STYLE_BG_IMAGE_SRC] = LV_STYLE_PROP_FLAG_EXT_DRAW_UPDATE,
[LV_STYLE_BG_IMAGE_OPA] = 0,
@@ -371,6 +372,8 @@ lv_style_value_t lv_style_prop_get_default(lv_style_prop_t prop)
case LV_STYLE_BORDER_OPA:
case LV_STYLE_TEXT_OPA:
case LV_STYLE_IMAGE_OPA:
+ case LV_STYLE_BG_GRAD_OPA:
+ case LV_STYLE_BG_MAIN_OPA:
case LV_STYLE_BG_IMAGE_OPA:
case LV_STYLE_OUTLINE_OPA:
case LV_STYLE_SHADOW_OPA:
diff --git a/src/misc/lv_style.h b/src/misc/lv_style.h
index adede6005db8..8b9166ccc07e 100644
--- a/src/misc/lv_style.h
+++ b/src/misc/lv_style.h
@@ -146,22 +146,6 @@ typedef uint8_t lv_grad_dir_t;
#endif /*DOXYGEN*/
-/**
- * The dithering algorithm for the gradient
- */
-enum _lv_dither_mode_t {
- LV_DITHER_NONE, /**< No dithering, colors are just quantized to the output resolution*/
- LV_DITHER_ORDERED, /**< Ordered dithering. Faster to compute and use less memory but lower quality*/
- LV_DITHER_ERR_DIFF, /**< Error diffusion mode. Slower to compute and use more memory but give highest dither quality*/
-};
-
-#ifdef DOXYGEN
-typedef _lv_dither_mode_t lv_dither_mode_t;
-#else
-typedef uint8_t lv_dither_mode_t;
-#endif /*DOXYGEN*/
-
-
/** A gradient stop definition.
* This matches a color and a position in a virtual 0-255 scale.
*/
@@ -177,8 +161,6 @@ typedef struct {
uint8_t stops_count; /**< The number of used stops in the array */
lv_grad_dir_t dir : 3; /**< The gradient direction.
* Any of LV_GRAD_DIR_HOR, LV_GRAD_DIR_VER, LV_GRAD_DIR_NONE */
- lv_dither_mode_t dither : 3; /**< Whether to dither the gradient or not.
- * Any of LV_DITHER_NONE, LV_DITHER_ORDERED, LV_DITHER_ERR_DIFF */
} lv_grad_dsc_t;
/**
@@ -235,13 +217,14 @@ enum _lv_style_prop_t {
LV_STYLE_BG_GRAD_DIR = 32,
- LV_STYLE_BG_GRAD_COLOR = 33,
- LV_STYLE_BG_MAIN_STOP = 34,
- LV_STYLE_BG_GRAD_STOP = 35,
-
- LV_STYLE_BG_GRAD = 36,
- LV_STYLE_BG_DITHER_MODE = 37,
- LV_STYLE_BASE_DIR = 38,
+ LV_STYLE_BG_MAIN_STOP = 33,
+ LV_STYLE_BG_GRAD_STOP = 34,
+ LV_STYLE_BG_GRAD_COLOR = 35,
+
+ LV_STYLE_BG_MAIN_OPA = 36,
+ LV_STYLE_BG_GRAD_OPA = 37,
+ LV_STYLE_BG_GRAD = 38,
+ LV_STYLE_BASE_DIR = 39,
LV_STYLE_BG_IMAGE_SRC = 40,
LV_STYLE_BG_IMAGE_OPA = 41,
diff --git a/src/misc/lv_style_gen.c b/src/misc/lv_style_gen.c
index dfe23c5e7d38..56b5fffb2ce8 100644
--- a/src/misc/lv_style_gen.c
+++ b/src/misc/lv_style_gen.c
@@ -350,25 +350,35 @@ void lv_style_set_bg_grad_stop(lv_style_t * style, lv_coord_t value)
const lv_style_prop_t _lv_style_const_prop_id_BG_GRAD_STOP = LV_STYLE_BG_GRAD_STOP;
-void lv_style_set_bg_grad(lv_style_t * style, const lv_grad_dsc_t * value)
+void lv_style_set_bg_main_opa(lv_style_t * style, lv_opa_t value)
{
lv_style_value_t v = {
- .ptr = value
+ .num = (int32_t)value
};
- lv_style_set_prop(style, LV_STYLE_BG_GRAD, v);
+ lv_style_set_prop(style, LV_STYLE_BG_MAIN_OPA, v);
}
-const lv_style_prop_t _lv_style_const_prop_id_BG_GRAD = LV_STYLE_BG_GRAD;
+const lv_style_prop_t _lv_style_const_prop_id_BG_MAIN_OPA = LV_STYLE_BG_MAIN_OPA;
-void lv_style_set_bg_dither_mode(lv_style_t * style, lv_dither_mode_t value)
+void lv_style_set_bg_grad_opa(lv_style_t * style, lv_opa_t value)
{
lv_style_value_t v = {
.num = (int32_t)value
};
- lv_style_set_prop(style, LV_STYLE_BG_DITHER_MODE, v);
+ lv_style_set_prop(style, LV_STYLE_BG_GRAD_OPA, v);
}
-const lv_style_prop_t _lv_style_const_prop_id_BG_DITHER_MODE = LV_STYLE_BG_DITHER_MODE;
+const lv_style_prop_t _lv_style_const_prop_id_BG_GRAD_OPA = LV_STYLE_BG_GRAD_OPA;
+
+void lv_style_set_bg_grad(lv_style_t * style, const lv_grad_dsc_t * value)
+{
+ lv_style_value_t v = {
+ .ptr = value
+ };
+ lv_style_set_prop(style, LV_STYLE_BG_GRAD, v);
+}
+
+const lv_style_prop_t _lv_style_const_prop_id_BG_GRAD = LV_STYLE_BG_GRAD;
void lv_style_set_bg_image_src(lv_style_t * style, const void * value)
{
diff --git a/src/misc/lv_style_gen.h b/src/misc/lv_style_gen.h
index d8d56917fbd3..4d0221d4b1b4 100644
--- a/src/misc/lv_style_gen.h
+++ b/src/misc/lv_style_gen.h
@@ -78,10 +78,12 @@ void lv_style_set_bg_main_stop(lv_style_t * style, lv_coord_t value);
extern const lv_style_prop_t _lv_style_const_prop_id_BG_MAIN_STOP;
void lv_style_set_bg_grad_stop(lv_style_t * style, lv_coord_t value);
extern const lv_style_prop_t _lv_style_const_prop_id_BG_GRAD_STOP;
+void lv_style_set_bg_main_opa(lv_style_t * style, lv_opa_t value);
+extern const lv_style_prop_t _lv_style_const_prop_id_BG_MAIN_OPA;
+void lv_style_set_bg_grad_opa(lv_style_t * style, lv_opa_t value);
+extern const lv_style_prop_t _lv_style_const_prop_id_BG_GRAD_OPA;
void lv_style_set_bg_grad(lv_style_t * style, const lv_grad_dsc_t * value);
extern const lv_style_prop_t _lv_style_const_prop_id_BG_GRAD;
-void lv_style_set_bg_dither_mode(lv_style_t * style, lv_dither_mode_t value);
-extern const lv_style_prop_t _lv_style_const_prop_id_BG_DITHER_MODE;
void lv_style_set_bg_image_src(lv_style_t * style, const void * value);
extern const lv_style_prop_t _lv_style_const_prop_id_BG_IMAGE_SRC;
void lv_style_set_bg_image_opa(lv_style_t * style, lv_opa_t value);
@@ -391,14 +393,19 @@ extern const lv_style_prop_t _lv_style_const_prop_id_GRID_CELL_ROW_SPAN;
.prop_ptr = &_lv_style_const_prop_id_BG_GRAD_STOP, .value = { .num = (int32_t)val } \
}
-#define LV_STYLE_CONST_BG_GRAD(val) \
+#define LV_STYLE_CONST_BG_MAIN_OPA(val) \
{ \
- .prop_ptr = &_lv_style_const_prop_id_BG_GRAD, .value = { .ptr = val } \
+ .prop_ptr = &_lv_style_const_prop_id_BG_MAIN_OPA, .value = { .num = (int32_t)val } \
}
-#define LV_STYLE_CONST_BG_DITHER_MODE(val) \
+#define LV_STYLE_CONST_BG_GRAD_OPA(val) \
{ \
- .prop_ptr = &_lv_style_const_prop_id_BG_DITHER_MODE, .value = { .num = (int32_t)val } \
+ .prop_ptr = &_lv_style_const_prop_id_BG_GRAD_OPA, .value = { .num = (int32_t)val } \
+ }
+
+#define LV_STYLE_CONST_BG_GRAD(val) \
+ { \
+ .prop_ptr = &_lv_style_const_prop_id_BG_GRAD, .value = { .ptr = val } \
}
#define LV_STYLE_CONST_BG_IMAGE_SRC(val) \
diff --git a/tests/src/lv_test_conf_full.h b/tests/src/lv_test_conf_full.h
index f415316a0a40..4ec0aa72c788 100644
--- a/tests/src/lv_test_conf_full.h
+++ b/tests/src/lv_test_conf_full.h
@@ -83,6 +83,7 @@
#define LV_USE_DEMO_STRESS 1
#define LV_USE_DEMO_TRANSFORM 1
#define LV_USE_DEMO_MULTILANG 1
+#define LV_USE_DEMO_RENDER 1
#define LV_USE_DEMO_SCROLL 1
#define LV_USE_OBJ_ID 1