Android 3D emulation Architecture

Source: Internet
Author: User

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.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.