Android Emulator provides the user with the GPU on option, which means using the GPU of Host (which is the PC that executes Emulator). Of course, the PC must have the OpenGL driver installed.
In the implementation is to replace the libglesv1_cm.so libglesv2.so, when the system calls GL's function, the call is packaged as a stream, and through the pipe sent to the host side processing, into the conversion to host OpenGL call.
Light is not enough, but also to Libegl, Libgralloc are replaced, because to call the host side of OpenGL must have rendercontext, so to the Android Egl also converted to host XGL call (assuming you use Ubuntu) .
Create
Normally, when an APK process needs to create a window, it calls the EGL function to create the Surface, also calls the Gralloc function to create the memory to hold the raster required by the Surface, and then associate the two, which is completed in this process, but in the Android 3D emulation architecture, Windows cannot be created directly, but must be created by sending commands to host side render to invoke XGL commands .
Surface corresponds to the windowsurface in the 3D Emulation, the raster memory corresponds to Colorbuffer in 3D Emulation.
The FrameBuffer is a virtual FrameBuffer in 3D emulation, and he centrally manages Colorbuffer, Windowsurface, and Rendercontext.
Update
When the APK calls Swapbuffers (that is, the screen that has already been painted, which requires each surface to provide image memory, a surfaceflinger to be processed and displayed on the screen), the ability to imagine that the drawing using OpenGL is over, is now running a series of memory copy, Colorbuffer the image of OpenGL to draw the image read out.
The eglmakecurrent of Elg provides the first surface to draw something, and the second is to read
public boolean eglmakecurrent (Egldisplay display, Eglsurface draw, Eglsurface read, eglcontext context);
The application should use Eglsurface draw when drawing something, this surface is backstage, invisible, just to be able to successfully invoke OpenGL for hardware rendering
Now on the screen, you need to draw the surface raster data to read back, of course, this is provided by eglmakecurrent
Read the surface raster memory for Surfaceflinger operation, the last generated screen image in Framebuffer, can be directly on the screen
At last you're in the emulator, and there's no problem running a racing game.