I'm using a library which provides me frames I have to blit to the screen. I allocate a buffer, and this library writes directly into this buffer. When I'm required, I have to blit a specified part of this buffer to the screen. I'm rendering using Qt with the OpenGL/ES paint engine.
Question is: what is the fastest way to blit to the screen? I'm currently loading the buffer in a QImage
using the constructor that accepts a pointer to data. This should avoid any copy. Then, I use the drawImage()
method of the QPainter
to blit to the screen the correct area. I guess this method loads a copy of the area to the GPU memory and then blits to the screen using an OpenGL texture.
Would it be possible to avoid this copy to speed up the process? Would it be possible for instance to draw directly in a OpenGL texture so that I don't have to transfer to the GPU? I read of pixel buffer objects. Might that be a solution? May I use for this purpose a QGLFramebufferObject
?