2. Legal info
Android internals by Egor Elizarov is licensed under a
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
You are free to
– copy, distribute, display, and perform the work
– make derivative works
Under the following conditions
– Attribution. You must give the original author credit
– Share Alike. If you alter, transform, or build upon this work, you may
distribute the resulting work only under a license identical to this one
All pictures and trademarks are the property of their respective owners. Use of
these trademarks and pictures is subject to owners permissions.
Corrections, suggestions, contributions and translations are welcome!
2 Egor Elizarov SPbSU 2012
7. Surface
Virtual buffer we can draw on
Can be marshalled/unmarlled in Parcel
One Activity can have more then one Surface
7 Egor Elizarov SPbSU 2012
8. Surface Flinger
Allocates surfaces
Composes surfaces
Can combines 2D/3D surfaces
Can use HW acceleration for surface
composition
8 Egor Elizarov SPbSU 2012
9. Window Manager
Dispatches input events to clients
Provides transition animation capabilities
Window Manager Policy handles common key
events in PhoneWindowManager
(Home/Back/Volume)
9 Egor Elizarov SPbSU 2012
13. Khronos OpenGL API
Khronos Group - not for profit industry
consortium creating open standards.
OpenGL – 2D/3D graphics API
OpenGLES – 2D/3D graphics API for embedded
systems
EGL – interface between OpenGLES and native
platform window system
13 Egor Elizarov SPbSU 2012
15. Renderscript
Renderscript is new API targeted at high-
performance 3D rendering and compute
operations.
Renderscript provides:
• 3D rendering API on top of HW acceleration
• compute API (similar to CUDA)
• familiar language in C99
15 Egor Elizarov SPbSU 2012
18. Composition approach
Dirty regions – regions that should be redrawn
Use Z ordering to compose layers
Use HW composer to compose layers if possible
frameworks/base/services/surfaceflinger/Surface
Flinger.cpp
18 Egor Elizarov SPbSU 2012
24. Overlay vs Framebuffer surface
Two different type of surfaces in Android < 3.0
Overlay
– Picture in YUV format (Video, Camera)
– Video4Linux devices (/dev/video*)
Framebuffer surfaces
– Picture in RGB format
– Framebuffer device (/dev/fb*)
Composition is performed by HW
24 Egor Elizarov SPbSU 2012
32. Thanks to
Sergey Matyukevich for review and advices
(www.linkedin.com/pub/sergey-matyukevich/31/889/769)
Nikolay F. Fominykh for review and advices
Nikita Shulga for advices and notes
(http://www.linkedin.com/pub/nikita-shulga/8/582/287)
Grigory Tolstolytkin for advices and notes
(http://www.linkedin.com/pub/grigory-
tolstolytkin/2a/b41/74)
32 Egor Elizarov SPbSU 2012