spinnenfeind Posted September 23, 2019 Report Posted September 23, 2019 Hello, when I started to use pixmaps I thought that it is an area with undefined content which you have to clear manually. As I learned, a new pixmap is initialized with the default background color GDISP_STARTUP_COLOR. Is there a way to choose the default color of a new pixmap dynamically at runtime? I think it's a waste of runtime to fill it with GDISP_STARTUP_COLOR first, and then overwrite it with the actually desired background color. Similar question for the orientation: I have to change the orientation of each pixmap that I create by using gdispGSetOrientation. Is there a way to set a default pixmap orientation? Thanks, spinnenfeind
Joel Bodenmann Posted November 4, 2019 Report Posted November 4, 2019 Hi, Currently there's no way to modify the behavior of the default clearing & orientation of the pixmaps. The startup color clearing behavior is implicitly implemented by the fact that a pixmap is just regular GDISP driver like any other "real" / "physical" display. The GDISP driver calls gdispInit() as part of the driver initialization - and therefore also when creating a new pixmap. The orientation is simply hardcoded. You can find the related code here: https://git.ugfx.io/uGFX/uGFX/src/master/src/gdisp/gdisp_pixmap.c#L113
spinnenfeind Posted November 7, 2019 Author Report Posted November 7, 2019 Thanks for your reply. It's not a high priority topic, because as I found out my STM32 micro has lot of computing power and I get high refresh rates also when I have to overwrite with my desired color. However, I just don't like the idea of having superfluous pixmap color filling - I always try to optimize, even it it's not necessary ? Is there a way to completely disable the background color initializations of all GDISPs (including pixmaps) that I use in my project? I would prefer to take care of it on my own and just get an uninitialized piece of display buffer / pixmap RAM.
Joel Bodenmann Posted November 9, 2019 Report Posted November 9, 2019 The clearing operation is currently hard coded in the GDISP driver post-init procedure: https://git.ugfx.io/uGFX/uGFX/src/master/src/gdisp/gdisp.c#L659 It would be rather easy to wrap that call in a macro such as `GDISP_STARTUP_CLEAR` so that it can be controller in the configuration file. Pull requests are welcomed ?
spinnenfeind Posted November 26, 2019 Author Report Posted November 26, 2019 Thank you Joel, this is very helpful for me. I did a local modification as recommended by you. I don't know anything about software versioning systems. If I want to do a pull request, I guess I need to sign up for GIT or CVS or something like that!? I will have a look at it, but it will need some time. Have a nice day!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now