Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(draw_sw): implemented radial gradient background #6170

Open
wants to merge 42 commits into
base: master
Choose a base branch
from

Conversation

zjanosy
Copy link
Contributor

@zjanosy zjanosy commented May 2, 2024

Description of the feature or fix

Implemented radial gradient background. Work in progress. For internal testing only.

Notes

Added example lv_example_styles_16.c. To test you need to add
#define LV_DRAW_SW_COMPLEX_GRADIENTS 1
to lv_conf.h, and add
extern "C" { void lv_example_style_16(void); }
to main.

Copy link
Member

@kisvegabor kisvegabor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, just a few minor comments at first look.

examples/styles/lv_example_style_16.c Outdated Show resolved Hide resolved
src/draw/sw/lv_draw_sw_gradient.c Show resolved Hide resolved
src/draw/sw/lv_draw_sw_gradient.c Outdated Show resolved Hide resolved
examples/styles/lv_example_style_17.c Outdated Show resolved Hide resolved
src/misc/lv_style.h Show resolved Hide resolved
src/misc/lv_style.h Outdated Show resolved Hide resolved
#if LV_USE_DRAW_SW_COMPLEX_GRADIENTS

/*
// Integer Square Root function
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Integer Square Root function
Integer Square Root function

src/draw/sw/lv_draw_sw_gradient.c Show resolved Hide resolved
@FASTSHIFT FASTSHIFT changed the title Feat/gradient: implemented radial gradient background feat(gradient): implemented radial gradient background May 12, 2024
@FASTSHIFT FASTSHIFT changed the title feat(gradient): implemented radial gradient background feat(draw_sw): implemented radial gradient background May 12, 2024
@kisvegabor
Copy link
Member

@zjanosy
It seems incredibly powerful! Please add some tests so that we can also see the whole power of this feature and also fix the CI failures. 🙂

src/draw/sw/lv_draw_sw_gradient.h Show resolved Hide resolved
src/draw/sw/lv_draw_sw_gradient.h Outdated Show resolved Hide resolved
kisvegabor
kisvegabor previously approved these changes May 22, 2024
Copy link
Collaborator

@liamHowatt liamHowatt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not done reviewing yet but here are some comments so far.

src/draw/sw/lv_draw_sw_gradient.c Outdated Show resolved Hide resolved
demos/render/lv_demo_render.c Outdated Show resolved Hide resolved
src/misc/lv_style.h Outdated Show resolved Hide resolved
@liamHowatt
Copy link
Collaborator

@kisvegabor, FYI, another instance of CI failing due to a memory error in the RLE decompressor. This time on 32 bit x86. Before it was 64 bit ARM.

Zoltan Janosy added 19 commits May 24, 2024 08:59
…t with othe defines. Added config option to Kconfig and lv_conf_template.
…check for simple cases (e.g. concentric circles).
…ircle instead of center and radius. This makes it possible to use percentages for the size of the gradient.
Zoltan Janosy and others added 20 commits May 24, 2024 08:59
…acity, and render into separate images with opacity (that's how other render tests worked).
…rototype, but not the implementation

Co-authored-by: Liam <30486941+liamHowatt@users.noreply.github.com>
@liamHowatt
Copy link
Collaborator

Impressive mathematics. If there were any more than the 3 added types of gradient and they also had the same function signatures for setup, get_line, and cleanup, I'd say make a function pointer table/struct, but that only stands to make things less readable and harder to change so I think this is great as-is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants