-
Notifications
You must be signed in to change notification settings - Fork 8.3k
drivers: display_sdl: support transparent screens #81184
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
Conversation
e7b40ee to
c691c6c
Compare
e9e89d3 to
fda6257
Compare
|
@Finomnis very nice! Could you share a screenshot of how https://github.com/zephyrproject-rtos/zephyr/tree/main/samples%2Fdrivers%2Fdisplay? |
Should we make it configurable via Kconfig? |
|
|
@kartben I'm very confused. Is the Alpha value 'transparent' in Zephyr defined as LVGL also does "transparent" as |
|
@kartben I can't find the definition of The entire This is very confusing and a little bit infuriating. What's going on? |
420b1df to
97d91dd
Compare
|
@kartben Made grid size and color Kconfig values. |
Yes that looks like a bug, they should be 0xff..... indeed |
|
@kartben Fixed alpha handling in |
79e0977 to
cf80afd
Compare
|
@kartben should I create an issue that gets fixed by this change or is it OK if this change exists on its own? |
The latter is fine! |
b4164a3 to
01a9191
Compare
@kartben In that case, is there any way to bump priority? It's currently really hard to develop apps with screen transparency :/ |
PR has been open for only a week, right as everyone was pretty busy getting 4.0 ready. Please allow some time for reviewers to have a look at it, likely next week, I would say :) |
Oh, I did not realize it's only been open for a week :D guess I'm being too impatient. Thanks for the response :) |
Adds a sample that renders the simple `hello world` LVGL demo with a transparent background, to demonstrate ARGB8888 framebuffer capabilities. Signed-off-by: Martin Stumpf <[email protected]>
`lv_task_handler()` returns a `uint32_t`, but `k_msleep` takes a `int32_t`. If no timer exists, `lv_task_handler()` returns `UINT32_MAX` to indicate that we should wait forever. However, this gets auto-cast to `-1`, indicating to `k_msleep` to not wait at all, creating a busy loop. Hence, a clamping to `[0, INT32_MAX]` is required. Signed-off-by: Martin Stumpf <[email protected]>
While the driver was already capable of processing `ARGB8888` data, it did not actually show the alpha value in any way. This change adds a checkerboard background that shows transparent regions. Signed-off-by: Martin Stumpf <[email protected]>
Non-alpha colors were converted to colors with `0x00` alpha, which makes them fully transparent. The correct way would be to add a `0xff` alpha, which this change does. Signed-off-by: Martin Stumpf <[email protected]>
9b3ad00 to
4cf8488
Compare
ARGB8888 values all had alpha '0x00' (=transparent). Changed them to '0xFF' and added a transparency test patch in the middle of the screen. Signed-off-by: Martin Stumpf <[email protected]>
4cf8488 to
625084f
Compare
Added release notes for PR zephyrproject-rtos#81184. Signed-off-by: Martin Stumpf <[email protected]>
625084f to
32e982d
Compare
|
@kartben Thanks for the review and your time :) |


The
display_sdlalready supportsARGB8888colors, but does not display them correctly.This PR performs the following things:
display_sdldriversamples/modules/lvgl/screen_transparencythat demonstrates its functionalitysamples/drivers/displayin ARGB8888 mode to have a transparent backgroundscreen_transparencysample before adding transparency support todisplay_sdl:with transparency support in

display_sdl:NOTE: The artifacts around the letters are a bug in LVGL. That bug is fixed in LVGL 9, but in 8.4, this is what it really looks like, this is not a mistake in the
display_sdldriver.This is the updated

samples/drivers/displayinARGB8888mode: