Android Graphics Internals
Asked Answered
G

4

46

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.

Guesthouse answered 2/1, 2011 at 17:35 Comment(1)
+1. Very useful for people like me who are suddenly given issues related to display.. :) could you please modify the link of linux frame buffer. It got changed and no more supported it seems. Thanks in advance..Panic
S
47

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.

Sillsby answered 15/2, 2011 at 17:38 Comment(7)
And the window manager is a distinguished process shared by all programs, similar a traditional display server? It owns exclusive access to the display device, etc.Guesthouse
The window manager lives in system_process but SurfaceFlinger owns the display device, not the window manager.Sillsby
I'm curious about your comment on DirectFB. If you look at the presentation at Jim Huang's presentation you will notice a reference to framebuffers on slides 30 and 31. How do those differ from DirectFB?Airla
@Romain Guy could you please answer to my comment posted above under the question? Also if possible please have a look at this : #16332275Panic
A detailed description of the architecture is now available here: source.android.com/devices/graphics/architecture.htmlRatline
@RomainGuy why wasn't x11 used for android? Any insights?Evolute
@SudipBhandari X11 is a terrible archaic piece when it comes to windowing systems and the modern desktop, it just makes sense to rip it out altogether when you are re-inventing a GUI stack from scratch on top the linux core. I am happy to learn that X11 is not part of Android.Punchdrunk
K
11

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

Kathikathiawar answered 5/1, 2012 at 8:21 Comment(1)
Just a caution: the latest versions are changed to a considerable extent. The information contained in the slides may be outdated..Panic
L
6

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.

Libbielibbna answered 8/3, 2013 at 5:34 Comment(4)
What could be good starting point to learn Android graphics stack ?Solanaceous
@ppu a shameless promotion of my blog pierrchen.blogspot.com, which talked quite a lot about android graphic internalLibbielibbna
I want to debug HWUI but I don't know how to do it. Any log can't put out.(PS:You are a Chinese and me too. so please give a hand.)Lascivious
@Libbielibbna this is super useful, thank you for sharing your knowledge.Dehnel
H
3

All the information about android graphics can be found here:

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

Hanker answered 27/7, 2016 at 15:49 Comment(1)
I wonder how much that's still current for current day versions, but looks like it's still an official pagePunchdrunk

© 2022 - 2024 — McMap. All rights reserved.