I’ve a scenario where I need to combine native pixmap and EGL Pixmap surface.
I’m planning to use QTPixmap as native pixmap. And in Vincent library I’m planning to implement eglCreatePixmapSurface() API. Has anyone tried this before?
The goal is to combine contents of native QTPixmap and EGL Pixmap surface to one single surface and then render it.
In EGL,I could find the API eglCopyBuffers(), which would copy color buffer to nativePixmap.
But I was thinking of defining a custom API that could do reverse operation i.e copy from nativepixmap to EGL Pixmap surface and then finally combine all EGL Pixmap surfaces to single EGL Pixmap surface and then render it to display window.
Could any one tell me which is the best approach?
option 1. Convert all surafce to native pixmap and then render it.
option2 . Convert all surface s to EGL Pixmpa surface and then render it.
Is there any other better approach to combine nativePixmap and EGL Pixmap.
EGL pixmaps are not actual entities. They are an EGL abstraction of an already existing native pixmap. A call to eglCreatePixmapSurface does not allocate any memory or create a pixmap. It only “wraps” a pre-existing pixmap in an EGL structure. If the implementation of EGL you are using defines an egl native pixmap as being a QTPixmap, then you should have no problems “wrapping” that pixmap using eglCreatePixmapSurface. If not, you need to (re)implement eglCreatePixmapSurface to accept QTPixmaps as the native pixmap type.
Hope this explains things
“If not, you need to (re)implement eglCreatePixmapSurface to accept QTPixmaps as the native pixmap type.”
Thanks for your reply.
I actually need to implement eglCreatePixmapSurface to accept QTPixmaps as native pixmap.
So it means I need to find a mapping between QTPixmap and EGLSurface. I have a question regarding the implementation of eglCreatePixmapSurface ().
I was thinking of copying the color buffer, alpha buffer,depth buffer from QTPixmap to corresponding elements in EGLSurface. Am I right?
I have an Application 1 which writes into QTPixmap(i.e NativePixmap) and another Application 2 which writes into EGLSurface (I plan to use PbBuffer for this). At the end I need to combine these two surfaces. So below are the steps I plan to do
Create QTPixmap. Application 1 renders into QTPixmap.
Create EGL Pbuffer Surface. Application 2 renders into this surface. I’ll denote it as EGLSurface2.
Convert QTPixmap to EGLSurface using eglCreatePixmapSurface() . I’ll denote it as EGLSurface1.
Now I need to combine EGLSurface1 and EGLSurface2 - say blend these surfaces and then display it on screen.
I don’t have any EGL functions to blend 2 surface like eglBlend(surface1,surface2). Also eglSwapBuffers() will work only with window surfaces.
So this I plan to do the below steps:
Create a window surface - EGLSurface3_write
eglMakeCurrent(display, EGLSurface3_write, EGLSurface1, context)
Copy the content of EGLSurface1 into texture using glCopyTexImage2D(). I don’t have eglBindTexture() implemented.
eglMakeCurrent(display, EGLSurface3_write, EGLSurface2, context)
Copy the content of EGLSurface2 into texture using glCopyTexImage2D().
How do I blend these 2 textures and finally show it in dispaly window. Is it using glBindTexture() and glBlend().
Is there any other efficient way to combine 2 EGL surfaces and display it.
This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.