Android Graphics Internals

2019-01-21 09:02发布

问题:

I haven't found a clear explanation on how the Android graphics system works, specifically, does it use a display server, is it based on DirectFB or X11, etc.

From what I've managed to piece together, Android depends on the Linux frame buffer. I haven't found much on what sort of display server or window manager Android uses to multiplex access to the framebuffer though, so any pointers would be much appreciated!

Finally, from what I understand the ARM instruction set provides instructions to accelerate OpenGL, but how this integrates with the display server isn't clear, ie. do client applications negotiate a shared memory buffer into which the client writes directly?

Are the OpenGL libraries for the platform accelerator open source? I've found some references suggesting they're closed source binaries. Again, any pointers would be appreciated.

回答1:

There are two core pieces to Android graphics: SurfaceFlinger and Skia. SurfaceFlinger is Android's compositor, used by the window manager to create and display windows (actually called surfaces.) SurfaceFlinger is implemented on top of OpenGL ES 1.x currently and can also use other hardware acceleration techniques when available (MDP, a 2D blitter on the T-Mobile G1, or hardware overlays on the Xoom.)

Each application renders into its windows (or surfaces) using primarily Skia. Skia is Android's 2D graphics library. You can also use OpenGL ES 1.x and 2.0 to render into a surface.

Android doesn't use DirectFB or X11 or any other existing Linux solution.



回答2:

There is a brief introduction presentation about Android Graphics: http://www.slideshare.net/jserv/design-and-concepts-of-android-graphics



回答3:

Romain Guy was definitely right. But thing changed since Android 3.0. Skia is not that important anymore , most 2D drawing are accelerated using openGL, a.k.a HWUI component.



回答4:

All the information about android graphics can be found here:

https://source.android.com/devices/graphics/