BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lvgl
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
lvgl
Commits
ca95d766
Commit
ca95d766
authored
Mar 22, 2018
by
Gabor Kiss-Vamosi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lv_conf.h: add LV_COMPILER_VLA_SUPPORTED
parent
d58a83cd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
7 deletions
+53
-7
lv_conf_templ.h
lv_conf_templ.h
+4
-3
lv_draw.c
lv_draw/lv_draw.c
+48
-3
lv_theme_mono.c
lv_themes/lv_theme_mono.c
+1
-1
No files found.
lv_conf_templ.h
View file @
ca95d766
...
@@ -81,9 +81,10 @@
...
@@ -81,9 +81,10 @@
#define USE_LV_REAL_DRAW 1 /*1: Enable function which draw directly to the frame buffer instead of VDB (required if LV_VDB_SIZE = 0)*/
#define USE_LV_REAL_DRAW 1 /*1: Enable function which draw directly to the frame buffer instead of VDB (required if LV_VDB_SIZE = 0)*/
#define USE_LV_FILESYSTEM 1 /*1: Enable file system (required by images*/
#define USE_LV_FILESYSTEM 1 /*1: Enable file system (required by images*/
/*Compiler attributes*/
/*Compiler settings*/
#define LV_ATTRIBUTE_TICK_INC /* Define a custom attribute to tick increment function */
#define LV_ATTRIBUTE_TICK_INC /* Define a custom attribute to `lv_tick_inc` function */
#define LV_ATTRIBUTE_TASK_HANDLER
#define LV_ATTRIBUTE_TASK_HANDLER /* Define a custom attribute to `lv_task_handler` function */
#define LV_COMPILER_VLA_SUPPORTED 1 /* 1: Variable length array is supported*/
/*================
/*================
* THEME USAGE
* THEME USAGE
...
...
lv_draw/lv_draw.c
View file @
ca95d766
...
@@ -448,7 +448,15 @@ void lv_draw_img(const lv_area_t * coords, const lv_area_t * mask,
...
@@ -448,7 +448,15 @@ void lv_draw_img(const lv_area_t * coords, const lv_area_t * mask,
lv_coord_t
row
;
lv_coord_t
row
;
uint32_t
act_pos
;
uint32_t
act_pos
;
#if LV_COMPILER_VLA_SUPPORTED
lv_color_t
buf
[
lv_area_get_width
(
&
mask_com
)];
lv_color_t
buf
[
lv_area_get_width
(
&
mask_com
)];
#else
# if LV_HOR_RES > LV_VER_RES
lv_color_t
buf
[
LV_HOR_RES
];
# else
lv_color_t
buf
[
LV_VER_RES
];
# endif
#endif
for
(
row
=
mask_com
.
y1
;
row
<=
mask_com
.
y2
;
row
++
)
{
for
(
row
=
mask_com
.
y1
;
row
<=
mask_com
.
y2
;
row
++
)
{
res
=
lv_fs_read
(
&
file
,
buf
,
useful_data
,
&
br
);
res
=
lv_fs_read
(
&
file
,
buf
,
useful_data
,
&
br
);
...
@@ -1713,8 +1721,15 @@ static void lv_draw_shadow_full(const lv_area_t * coords, const lv_area_t * mask
...
@@ -1713,8 +1721,15 @@ static void lv_draw_shadow_full(const lv_area_t * coords, const lv_area_t * mask
if
(
radius
!=
0
)
radius
-=
LV_ANTIALIAS
;
if
(
radius
!=
0
)
radius
-=
LV_ANTIALIAS
;
swidth
+=
LV_ANTIALIAS
;
swidth
+=
LV_ANTIALIAS
;
#if LV_COMPILER_VLA_SUPPORTED
lv_coord_t
curve_x
[
radius
+
swidth
+
1
];
/*Stores the 'x' coordinates of a quarter circle.*/
lv_coord_t
curve_x
[
radius
+
swidth
+
1
];
/*Stores the 'x' coordinates of a quarter circle.*/
#else
# if LV_HOR_RES > LV_VER_RES
lv_coord_t
curve_x
[
LV_HOR_RES
];
# else
lv_coord_t
curve_x
[
LV_VER_RES
];
# endif
#endif
memset
(
curve_x
,
0
,
sizeof
(
curve_x
));
memset
(
curve_x
,
0
,
sizeof
(
curve_x
));
lv_point_t
circ
;
lv_point_t
circ
;
lv_coord_t
circ_tmp
;
lv_coord_t
circ_tmp
;
...
@@ -1727,15 +1742,30 @@ static void lv_draw_shadow_full(const lv_area_t * coords, const lv_area_t * mask
...
@@ -1727,15 +1742,30 @@ static void lv_draw_shadow_full(const lv_area_t * coords, const lv_area_t * mask
int16_t
line
;
int16_t
line
;
int16_t
filter_width
=
2
*
swidth
+
1
;
int16_t
filter_width
=
2
*
swidth
+
1
;
#if LV_COMPILER_VLA_SUPPORTED
uint32_t
line_1d_blur
[
filter_width
];
uint32_t
line_1d_blur
[
filter_width
];
#else
# if LV_HOR_RES > LV_VER_RES
uint32_t
line_1d_blur
[
LV_HOR_RES
];
# else
uint32_t
line_1d_blur
[
LV_VER_RES
];
# endif
#endif
/*1D Blur horizontally*/
/*1D Blur horizontally*/
for
(
line
=
0
;
line
<
filter_width
;
line
++
)
{
for
(
line
=
0
;
line
<
filter_width
;
line
++
)
{
line_1d_blur
[
line
]
=
(
uint32_t
)((
uint32_t
)(
filter_width
-
line
)
*
(
style
->
body
.
opa
*
2
)
<<
SHADOW_OPA_EXTRA_PRECISION
)
/
(
filter_width
*
filter_width
);
line_1d_blur
[
line
]
=
(
uint32_t
)((
uint32_t
)(
filter_width
-
line
)
*
(
style
->
body
.
opa
*
2
)
<<
SHADOW_OPA_EXTRA_PRECISION
)
/
(
filter_width
*
filter_width
);
}
}
uint16_t
col
;
uint16_t
col
;
#if LV_COMPILER_VLA_SUPPORTED
lv_opa_t
line_2d_blur
[
radius
+
swidth
];
lv_opa_t
line_2d_blur
[
radius
+
swidth
];
#else
# if LV_HOR_RES > LV_VER_RES
lv_opa_t
line_2d_blur
[
LV_HOR_RES
];
# else
lv_opa_t
line_2d_blur
[
LV_VER_RES
];
# endif
#endif
lv_point_t
point_rt
;
lv_point_t
point_rt
;
lv_point_t
point_rb
;
lv_point_t
point_rb
;
...
@@ -1845,8 +1875,15 @@ static void lv_draw_shadow_bottom(const lv_area_t * coords, const lv_area_t * ma
...
@@ -1845,8 +1875,15 @@ static void lv_draw_shadow_bottom(const lv_area_t * coords, const lv_area_t * ma
radius
=
lv_draw_cont_radius_corr
(
radius
,
width
,
height
);
radius
=
lv_draw_cont_radius_corr
(
radius
,
width
,
height
);
radius
+=
LV_ANTIALIAS
*
SHADOW_BOTTOM_AA_EXTRA_RADIUS
;
radius
+=
LV_ANTIALIAS
*
SHADOW_BOTTOM_AA_EXTRA_RADIUS
;
swidth
+=
LV_ANTIALIAS
;
swidth
+=
LV_ANTIALIAS
;
#if LV_COMPILER_VLA_SUPPORTED
lv_coord_t
curve_x
[
radius
+
1
];
/*Stores the 'x' coordinates of a quarter circle.*/
lv_coord_t
curve_x
[
radius
+
1
];
/*Stores the 'x' coordinates of a quarter circle.*/
#else
# if LV_HOR_RES > LV_VER_RES
lv_coord_t
curve_x
[
LV_HOR_RES
];
# else
lv_coord_t
curve_x
[
LV_VER_RES
];
# endif
#endif
lv_point_t
circ
;
lv_point_t
circ
;
lv_coord_t
circ_tmp
;
lv_coord_t
circ_tmp
;
lv_circ_init
(
&
circ
,
&
circ_tmp
,
radius
);
lv_circ_init
(
&
circ
,
&
circ_tmp
,
radius
);
...
@@ -1857,7 +1894,15 @@ static void lv_draw_shadow_bottom(const lv_area_t * coords, const lv_area_t * ma
...
@@ -1857,7 +1894,15 @@ static void lv_draw_shadow_bottom(const lv_area_t * coords, const lv_area_t * ma
}
}
int16_t
col
;
int16_t
col
;
#if LV_COMPILER_VLA_SUPPORTED
lv_opa_t
line_1d_blur
[
swidth
];
lv_opa_t
line_1d_blur
[
swidth
];
#else
# if LV_HOR_RES > LV_VER_RES
lv_opa_t
line_1d_blur
[
LV_HOR_RES
];
# else
lv_opa_t
line_1d_blur
[
LV_VER_RES
];
# endif
#endif
for
(
col
=
0
;
col
<
swidth
;
col
++
)
{
for
(
col
=
0
;
col
<
swidth
;
col
++
)
{
line_1d_blur
[
col
]
=
(
uint32_t
)((
uint32_t
)(
swidth
-
col
)
*
style
->
body
.
opa
/
2
)
/
(
swidth
);
line_1d_blur
[
col
]
=
(
uint32_t
)((
uint32_t
)(
swidth
-
col
)
*
style
->
body
.
opa
/
2
)
/
(
swidth
);
...
...
lv_themes/lv_theme_mono.c
View file @
ca95d766
...
@@ -456,7 +456,7 @@ lv_theme_t * lv_theme_mono_init(uint16_t hue, lv_font_t *font)
...
@@ -456,7 +456,7 @@ lv_theme_t * lv_theme_mono_init(uint16_t hue, lv_font_t *font)
* Get a pointer to the theme
* Get a pointer to the theme
* @return pointer to the theme
* @return pointer to the theme
*/
*/
lv_theme_t
*
lv_theme_get_
templ
(
void
)
lv_theme_t
*
lv_theme_get_
mono
(
void
)
{
{
return
&
theme
;
return
&
theme
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment