Jump to content

Double buffer style


Fabien Comte

Recommended Posts

Hello,

I already asked a close question how to use a double buffer. Response was not possible. I have some blink issues when i move a simple buton due to buton background fill. Is there any way to prepare a full render in a pixmap and swap (unsynchronized with display) when done.

If not, is there any way to draw completly a control on a pixmap and write it on display when all processing was done ?

Thank you

ps: my target is linux framebuffer.

Link to comment
Share on other sites

Yes, that's possible. With µGFX, almost anything is possible in these regards.

  • You can use a pixmap which is only the size of the button, render the button and then blit the finished one to the actual framebuffer
  • You can also implement full-screen double buffering
  • You can also implement driver level double buffering
  • You can also implement hardware supported double buffering
  • ...

What works best (and what's possible) depends on the application, used platform, available resources and so on. There's no general guide to double buffering. In our daily work for customers we use all of the methods above. As always: The right tool for the right job. Each method has different advantages, disadvantages, requirements, complexities and so on.

You might also want to keep in mind that flickering can occur from different sources.

Link to comment
Share on other sites

Sorry for writing to this topic. but I have similar needs. I have two displays, one of them is ordinary display with RGB565, and second one - framebuffer with GRAYSCALE256 pixel format. I need to write text to this framebuffer, and after text will be drawn on it - set it as front framebuffer to be actually displayed at screen. I make my own draws in framebuffer (not using uGFX), then call gdispGDrawStringBox, then switch buffers. On screen I can see or normal (fully rendered) text, or incompletely rendered text, or even part of text with gray color, part of it with white color (why? it renders text twice?). I cannot use pixmaps because text should be drawn over pixels in framebuffer, not copied as rectangular area with pixmap background.

I also want to be able to switch buffers only when I will be sure that everything is drawn on back framebuffer.

Pixmaps is the only way to get synchronous draws in uGFX?

Maybe there is a way to tell uGFX that some calls should be rendered immediately and in a synchronous way (do not return from function until it will draw everything requested)?

Link to comment
Share on other sites

  • 3 weeks later...

This is a very complex question and given that we can't see what you are talking about it is very hard for us to provide an answer.

The only hint I can give you is to say that if you are using GWIN to render buttons etc there are gfxconf configuration macros that can affect GWIN's synchronisation methodology. Have a look at the GWIN redraw settings.

Link to comment
Share on other sites

If you take a simple button, you can see that the text draw is after the retangle draw. I modified some controls to use pixmaps for compositions and display is very clean. I can move controls with no blink effect now

Thank you all people for your help.

Edited by Fabien Comte
Link to comment
Share on other sites

54 minutes ago, Fabien Comte said:

If you take a simple button, you can see that the text draw is after the retangle draw. I modified some controls to use pixmaps for compositions and display is very clean. I can move controls with no blink effect now

Yep that's often done in applications. That's definitely a proper way to handle things. In fact, the µGFX-Studio does that internally as well.

Link to comment
Share on other sites

  • 1 month later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...