Android Emulator provides the GPU on option, which means that the GPU of Host (the PC running Emulator) is used. Of course, the OpenGL driver must be installed on the PC.
In implementation, libGLESv1_CM.so libGLESv2.so is replaced. When the system calls the gl function, it packs the call as stream and sends it to the host for processing through pipe, to call host opengl.
This is not enough. We need to replace libegl and libgralloc, because rendercontext must be available to call host-side opengl, therefore, we need to convert android egl into the xgl call of host (if you use ubuntu ).
Create
Normally, when an apk process needs to create a form, it calls the egl function to create the Surface, and also calls the gralloc function to create memory to store the grating required by the Surface, then, the two are associated. These are all completed in this process. However, in the Android 3D emulation architecture, the form cannot be directly created, however, you must send a command to the host render to call the xgl command to create
The Surface corresponds to the WindowSurface in 3D Emulation, and the grating memory corresponds to the ColorBuffer in 3D Emulation.
FrameBuffer is a virtual FrameBuffer in 3D emulation. It centrally manages ColorBuffer, WindowSurface, and RenderContext.
Update
When the APK calls swapBuffers (that is, the painted screen, which requires the image memory of each Surface, SurfaceFlinger for processing and display on the screen), we can imagine that the drawing with opengl has ended, now we are executing a series of memory copies. How does ColorBuffer convert Z? Http://www.bkjia.com/kf/ware/vc/ "target =" _ blank "class =" keylink "> encrypt/bAtC48L3A + six + uPa + six/six + pc9wpgo8cd7p1t0000c/six + tests/tests + CjxwPjxpbWcgc3JjPQ = = "http://www.2cto.com/uploadfile/Collfiles/20140509/20140509091914216.jpg" alt = "\">
Finally, in emulator, it's okay to run a racing game.