SlideShare uma empresa Scribd logo
1 de 32
Baixar para ler offline
Android internals
     Egor Elizarov
     SPbSU 2012
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
Lecture 7



                            Graphic Subsystem
                          OpenGL HW acceleration



                                                    yegor.yelizarov(at)gmail.com
Rev: 1.1
Last update: 06/01/2012                            http://vk.com/android_internals



                                    3                              Egor Elizarov SPbSU 2012
Previous time
   Linux IPC primitives
   Binder
   Application layer
   Service manager
   Middleware level
   Kernel level
   Typical Android sybsystem


                                4   Egor Elizarov SPbSU 2012
Graphic subsystem


    Provides buffer to application for drawing

    Provides interfaces for draw primitives

    Controls and composes surfaces (windows)

    Provides 2D & 3D primitives

    Uses HW acceleration where acceptable


                           5                     Egor Elizarov SPbSU 2012
Main players



    Surface Flinger

    Window Manager

    Activity Manager




                       6       Egor Elizarov SPbSU 2012
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
Surface Flinger


    Allocates surfaces

    Composes surfaces

    Can combines 2D/3D surfaces

    Can use HW acceleration for surface
    composition


                          8               Egor Elizarov SPbSU 2012
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
Activity manager



    Manages activity life cycle

    Manages activity stacking

    Dispatches intents

    Spawn processes



                           10     Egor Elizarov SPbSU 2012
Composition example




         11           Egor Elizarov SPbSU 2012
Simple view




     12       Egor Elizarov SPbSU 2012
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
Graphic libraries


    SKIA - 2D graphic library

    PixelFlinger – android software renderer

    Codeflinger – simple graphic JIT

    Gralloc – android graphics memory allocator

    Mesa – open source OpenGL implementation


                          14                   Egor Elizarov SPbSU 2012
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
Java/middleware interaction




             16          Egor Elizarov SPbSU 2012
Double buffering




       17          Egor Elizarov SPbSU 2012
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
SW vs HW OpenGL




       19         Egor Elizarov SPbSU 2012
Middleware level




        20         Egor Elizarov SPbSU 2012
3D acceleration




       21         Egor Elizarov SPbSU 2012
2D acceleration




       22         Egor Elizarov SPbSU 2012
HAL/kernel interaction




           23            Egor Elizarov SPbSU 2012
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
HWComposer (Omap4)




        25           Egor Elizarov SPbSU 2012
Emulator GL acceleration



    In ICS Android team added GL acceleration for
    Emulator

    Emulator uses x86 host GL acceleration relying
    on host hardware accelerated libraries



                          26                  Egor Elizarov SPbSU 2012
Android-emulator approach




            27         Egor Elizarov SPbSU 2012
Android-x86 approach




         28            Egor Elizarov SPbSU 2012
Next Time




    System start up

    Media subsystem




                      29     Egor Elizarov SPbSU 2012
Useful links

    http://vk.com/android_internals


    http://www.slideshare.net/jserv/design-and-concepts-of-android-
    graphics


    http://people.debian.org.tw/~olv/surfaceflinger/surfaceflinger.pdf


    http://www.cnblogs.com/xl19862005/archive/2011/11/17/22153
    63.html


    Http://www.khronos.org


    https://plus.google.com/105051985738280261832/posts/2FXDC
    z8x93s
                                   30                           Egor Elizarov SPbSU 2012
Useful links (2)

    http://www.ti.com/lit/wp/swpy027/swpy027.pdf


    http://www.freescale.com/files/ftf_2010/Americas/FTF10_FT
    F-ENT-F0824.pdf


    http://elinux.org/images/0/02/Android_Platform_Optimization
    s_SNPS_20111027.pdf


    http://android-developers.blogspot.com/2011/02/introducing-
    renderscript.html


    http://android-
    developers.blogspot.com/2011/03/renderscript.html

                                 31                        Egor Elizarov SPbSU 2012
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

Mais conteúdo relacionado

Mais procurados

Understaing Android EGL
Understaing Android EGLUnderstaing Android EGL
Understaing Android EGLSuhan Lee
 
Learning AOSP - Android Booting Process
Learning AOSP - Android Booting ProcessLearning AOSP - Android Booting Process
Learning AOSP - Android Booting ProcessNanik Tolaram
 
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...Opersys inc.
 
Learning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device DriverLearning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device DriverNanik Tolaram
 
Understanding the Android System Server
Understanding the Android System ServerUnderstanding the Android System Server
Understanding the Android System ServerOpersys inc.
 
Embedded Android Workshop
Embedded Android WorkshopEmbedded Android Workshop
Embedded Android WorkshopOpersys inc.
 
Google I/O 2011, Android Accelerated Rendering
Google I/O 2011, Android Accelerated RenderingGoogle I/O 2011, Android Accelerated Rendering
Google I/O 2011, Android Accelerated RenderingRomain Guy
 
Android Boot Time Optimization
Android Boot Time OptimizationAndroid Boot Time Optimization
Android Boot Time OptimizationKan-Ru Chen
 
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...Opersys inc.
 
Inside Android's UI
Inside Android's UIInside Android's UI
Inside Android's UIOpersys inc.
 
Container based android
Container based androidContainer based android
Container based androidLihan Chen
 
Android crash debugging
Android crash debuggingAndroid crash debugging
Android crash debuggingAshish Agrawal
 
Intro to unreal with framework and vr
Intro to unreal with framework and vrIntro to unreal with framework and vr
Intro to unreal with framework and vrLuis Cataldi
 

Mais procurados (20)

Low Level View of Android System Architecture
Low Level View of Android System ArchitectureLow Level View of Android System Architecture
Low Level View of Android System Architecture
 
Understaing Android EGL
Understaing Android EGLUnderstaing Android EGL
Understaing Android EGL
 
Android Internals
Android InternalsAndroid Internals
Android Internals
 
Explore Android Internals
Explore Android InternalsExplore Android Internals
Explore Android Internals
 
Binder: Android IPC
Binder: Android IPCBinder: Android IPC
Binder: Android IPC
 
Learning AOSP - Android Booting Process
Learning AOSP - Android Booting ProcessLearning AOSP - Android Booting Process
Learning AOSP - Android Booting Process
 
Android Binder: Deep Dive
Android Binder: Deep DiveAndroid Binder: Deep Dive
Android Binder: Deep Dive
 
Applied Computer Science Concepts in Android
Applied Computer Science Concepts in AndroidApplied Computer Science Concepts in Android
Applied Computer Science Concepts in Android
 
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
 
Learning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device DriverLearning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device Driver
 
Understanding the Android System Server
Understanding the Android System ServerUnderstanding the Android System Server
Understanding the Android System Server
 
Embedded Android Workshop
Embedded Android WorkshopEmbedded Android Workshop
Embedded Android Workshop
 
Google I/O 2011, Android Accelerated Rendering
Google I/O 2011, Android Accelerated RenderingGoogle I/O 2011, Android Accelerated Rendering
Google I/O 2011, Android Accelerated Rendering
 
Android Boot Time Optimization
Android Boot Time OptimizationAndroid Boot Time Optimization
Android Boot Time Optimization
 
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
 
Inside Android's UI
Inside Android's UIInside Android's UI
Inside Android's UI
 
Container based android
Container based androidContainer based android
Container based android
 
Building aosp
Building aospBuilding aosp
Building aosp
 
Android crash debugging
Android crash debuggingAndroid crash debugging
Android crash debugging
 
Intro to unreal with framework and vr
Intro to unreal with framework and vrIntro to unreal with framework and vr
Intro to unreal with framework and vr
 

Semelhante a Android internals 07 - Android graphics (rev_1.1)

Android internals 10 - Debugging/Profiling, Bluetooth/WiFI/RIL (rev_1.1)
Android internals 10 - Debugging/Profiling, Bluetooth/WiFI/RIL (rev_1.1)Android internals 10 - Debugging/Profiling, Bluetooth/WiFI/RIL (rev_1.1)
Android internals 10 - Debugging/Profiling, Bluetooth/WiFI/RIL (rev_1.1)Egor Elizarov
 
Android internals 08 - System start up, Media subsystem (rev_1.1)
Android internals 08 - System start up, Media subsystem (rev_1.1)Android internals 08 - System start up, Media subsystem (rev_1.1)
Android internals 08 - System start up, Media subsystem (rev_1.1)Egor Elizarov
 
Android internals 06 - Binder, Typical subsystem (rev_1.1)
Android internals 06 - Binder, Typical subsystem (rev_1.1)Android internals 06 - Binder, Typical subsystem (rev_1.1)
Android internals 06 - Binder, Typical subsystem (rev_1.1)Egor Elizarov
 
Android internals 03 - Build system, emulator (rev_1.1)
Android internals 03 - Build system, emulator (rev_1.1)Android internals 03 - Build system, emulator (rev_1.1)
Android internals 03 - Build system, emulator (rev_1.1)Egor Elizarov
 
Android internals 01 - Basic concepts of mobile platforms (rev_1.1)
Android internals 01 - Basic concepts of mobile platforms (rev_1.1)Android internals 01 - Basic concepts of mobile platforms (rev_1.1)
Android internals 01 - Basic concepts of mobile platforms (rev_1.1)Egor Elizarov
 
Android internals 05 - Dalvik VM (rev_1.1)
Android internals 05 - Dalvik VM (rev_1.1)Android internals 05 - Dalvik VM (rev_1.1)
Android internals 05 - Dalvik VM (rev_1.1)Egor Elizarov
 
Android internals 02 - High-level architecture, version control system (rev_1.1)
Android internals 02 - High-level architecture, version control system (rev_1.1)Android internals 02 - High-level architecture, version control system (rev_1.1)
Android internals 02 - High-level architecture, version control system (rev_1.1)Egor Elizarov
 
Android internals 09 - Sensors, Power Management, Input subsystem, Data stora...
Android internals 09 - Sensors, Power Management, Input subsystem, Data stora...Android internals 09 - Sensors, Power Management, Input subsystem, Data stora...
Android internals 09 - Sensors, Power Management, Input subsystem, Data stora...Egor Elizarov
 
Android internals 04 - “Androdized” kernel, Bionic, Logging subsystem (rev_1.1)
Android internals 04 - “Androdized” kernel, Bionic, Logging subsystem (rev_1.1)Android internals 04 - “Androdized” kernel, Bionic, Logging subsystem (rev_1.1)
Android internals 04 - “Androdized” kernel, Bionic, Logging subsystem (rev_1.1)Egor Elizarov
 
OpenGL ES Presentation
OpenGL ES PresentationOpenGL ES Presentation
OpenGL ES PresentationEric Cheng
 
Android internals 00 - Introduction (rev_1.1)
Android internals 00 - Introduction (rev_1.1)Android internals 00 - Introduction (rev_1.1)
Android internals 00 - Introduction (rev_1.1)Egor Elizarov
 
Android OpenGL ES remote rendering 蕭從恩
Android OpenGL ES remote rendering 蕭從恩Android OpenGL ES remote rendering 蕭從恩
Android OpenGL ES remote rendering 蕭從恩Tsung-en Hsiao
 
Comparison between Eclipse and Android Studio for Android Development
Comparison between Eclipse and Android Studio for Android DevelopmentComparison between Eclipse and Android Studio for Android Development
Comparison between Eclipse and Android Studio for Android DevelopmentWillow Cheng
 
AspectJ Android with Example
AspectJ Android with ExampleAspectJ Android with Example
AspectJ Android with Examplefirstthumb
 
Webgl 기술동향 2011.8
Webgl 기술동향 2011.8Webgl 기술동향 2011.8
Webgl 기술동향 2011.8Seung Joon Choi
 
13th kandroid OpenGL and EGL
13th kandroid OpenGL and EGL13th kandroid OpenGL and EGL
13th kandroid OpenGL and EGLJungsoo Nam
 
Android Audio & OpenSL
Android Audio & OpenSLAndroid Audio & OpenSL
Android Audio & OpenSLYoss Cohen
 
Seminar presentation on OpenGL
Seminar presentation on OpenGLSeminar presentation on OpenGL
Seminar presentation on OpenGLMegha V
 
Angular JS 2_0 BCS CTO_in_Res V3
Angular JS 2_0 BCS CTO_in_Res V3Angular JS 2_0 BCS CTO_in_Res V3
Angular JS 2_0 BCS CTO_in_Res V3Bruce Pentreath
 
LCA13: OpenGL ES3 and You
LCA13: OpenGL ES3 and YouLCA13: OpenGL ES3 and You
LCA13: OpenGL ES3 and YouLinaro
 

Semelhante a Android internals 07 - Android graphics (rev_1.1) (20)

Android internals 10 - Debugging/Profiling, Bluetooth/WiFI/RIL (rev_1.1)
Android internals 10 - Debugging/Profiling, Bluetooth/WiFI/RIL (rev_1.1)Android internals 10 - Debugging/Profiling, Bluetooth/WiFI/RIL (rev_1.1)
Android internals 10 - Debugging/Profiling, Bluetooth/WiFI/RIL (rev_1.1)
 
Android internals 08 - System start up, Media subsystem (rev_1.1)
Android internals 08 - System start up, Media subsystem (rev_1.1)Android internals 08 - System start up, Media subsystem (rev_1.1)
Android internals 08 - System start up, Media subsystem (rev_1.1)
 
Android internals 06 - Binder, Typical subsystem (rev_1.1)
Android internals 06 - Binder, Typical subsystem (rev_1.1)Android internals 06 - Binder, Typical subsystem (rev_1.1)
Android internals 06 - Binder, Typical subsystem (rev_1.1)
 
Android internals 03 - Build system, emulator (rev_1.1)
Android internals 03 - Build system, emulator (rev_1.1)Android internals 03 - Build system, emulator (rev_1.1)
Android internals 03 - Build system, emulator (rev_1.1)
 
Android internals 01 - Basic concepts of mobile platforms (rev_1.1)
Android internals 01 - Basic concepts of mobile platforms (rev_1.1)Android internals 01 - Basic concepts of mobile platforms (rev_1.1)
Android internals 01 - Basic concepts of mobile platforms (rev_1.1)
 
Android internals 05 - Dalvik VM (rev_1.1)
Android internals 05 - Dalvik VM (rev_1.1)Android internals 05 - Dalvik VM (rev_1.1)
Android internals 05 - Dalvik VM (rev_1.1)
 
Android internals 02 - High-level architecture, version control system (rev_1.1)
Android internals 02 - High-level architecture, version control system (rev_1.1)Android internals 02 - High-level architecture, version control system (rev_1.1)
Android internals 02 - High-level architecture, version control system (rev_1.1)
 
Android internals 09 - Sensors, Power Management, Input subsystem, Data stora...
Android internals 09 - Sensors, Power Management, Input subsystem, Data stora...Android internals 09 - Sensors, Power Management, Input subsystem, Data stora...
Android internals 09 - Sensors, Power Management, Input subsystem, Data stora...
 
Android internals 04 - “Androdized” kernel, Bionic, Logging subsystem (rev_1.1)
Android internals 04 - “Androdized” kernel, Bionic, Logging subsystem (rev_1.1)Android internals 04 - “Androdized” kernel, Bionic, Logging subsystem (rev_1.1)
Android internals 04 - “Androdized” kernel, Bionic, Logging subsystem (rev_1.1)
 
OpenGL ES Presentation
OpenGL ES PresentationOpenGL ES Presentation
OpenGL ES Presentation
 
Android internals 00 - Introduction (rev_1.1)
Android internals 00 - Introduction (rev_1.1)Android internals 00 - Introduction (rev_1.1)
Android internals 00 - Introduction (rev_1.1)
 
Android OpenGL ES remote rendering 蕭從恩
Android OpenGL ES remote rendering 蕭從恩Android OpenGL ES remote rendering 蕭從恩
Android OpenGL ES remote rendering 蕭從恩
 
Comparison between Eclipse and Android Studio for Android Development
Comparison between Eclipse and Android Studio for Android DevelopmentComparison between Eclipse and Android Studio for Android Development
Comparison between Eclipse and Android Studio for Android Development
 
AspectJ Android with Example
AspectJ Android with ExampleAspectJ Android with Example
AspectJ Android with Example
 
Webgl 기술동향 2011.8
Webgl 기술동향 2011.8Webgl 기술동향 2011.8
Webgl 기술동향 2011.8
 
13th kandroid OpenGL and EGL
13th kandroid OpenGL and EGL13th kandroid OpenGL and EGL
13th kandroid OpenGL and EGL
 
Android Audio & OpenSL
Android Audio & OpenSLAndroid Audio & OpenSL
Android Audio & OpenSL
 
Seminar presentation on OpenGL
Seminar presentation on OpenGLSeminar presentation on OpenGL
Seminar presentation on OpenGL
 
Angular JS 2_0 BCS CTO_in_Res V3
Angular JS 2_0 BCS CTO_in_Res V3Angular JS 2_0 BCS CTO_in_Res V3
Angular JS 2_0 BCS CTO_in_Res V3
 
LCA13: OpenGL ES3 and You
LCA13: OpenGL ES3 and YouLCA13: OpenGL ES3 and You
LCA13: OpenGL ES3 and You
 

Último

Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1GloryAnnCastre1
 
How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17Celine George
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
How to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseHow to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseCeline George
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Projectjordimapav
 
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Association for Project Management
 
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxMan or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxDhatriParmar
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfVanessa Camilleri
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operationalssuser3e220a
 
Multi Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP ModuleMulti Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP ModuleCeline George
 
4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptxmary850239
 
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvRicaMaeCastro1
 
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
Unraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptxUnraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptx
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptxDhatriParmar
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptxmary850239
 
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxBIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxSayali Powar
 
4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptxmary850239
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfPatidar M
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdfMr Bounab Samir
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...Nguyen Thanh Tu Collection
 
Narcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfNarcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfPrerana Jadhav
 

Último (20)

Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1
 
How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
How to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseHow to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 Database
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Project
 
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
 
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxMan or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdf
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operational
 
Multi Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP ModuleMulti Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP Module
 
4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx
 
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
 
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
Unraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptxUnraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptx
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx
 
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxBIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
 
4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdf
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdf
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
 
Narcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfNarcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdf
 

Android internals 07 - Android graphics (rev_1.1)

  • 1. Android internals Egor Elizarov SPbSU 2012
  • 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
  • 3. Lecture 7 Graphic Subsystem OpenGL HW acceleration yegor.yelizarov(at)gmail.com Rev: 1.1 Last update: 06/01/2012 http://vk.com/android_internals 3 Egor Elizarov SPbSU 2012
  • 4. Previous time  Linux IPC primitives  Binder  Application layer  Service manager  Middleware level  Kernel level  Typical Android sybsystem 4 Egor Elizarov SPbSU 2012
  • 5. Graphic subsystem  Provides buffer to application for drawing  Provides interfaces for draw primitives  Controls and composes surfaces (windows)  Provides 2D & 3D primitives  Uses HW acceleration where acceptable 5 Egor Elizarov SPbSU 2012
  • 6. Main players  Surface Flinger  Window Manager  Activity Manager 6 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
  • 10. Activity manager  Manages activity life cycle  Manages activity stacking  Dispatches intents  Spawn processes 10 Egor Elizarov SPbSU 2012
  • 11. Composition example 11 Egor Elizarov SPbSU 2012
  • 12. Simple view 12 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
  • 14. Graphic libraries  SKIA - 2D graphic library  PixelFlinger – android software renderer  Codeflinger – simple graphic JIT  Gralloc – android graphics memory allocator  Mesa – open source OpenGL implementation 14 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
  • 16. Java/middleware interaction 16 Egor Elizarov SPbSU 2012
  • 17. Double buffering 17 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
  • 19. SW vs HW OpenGL 19 Egor Elizarov SPbSU 2012
  • 20. Middleware level 20 Egor Elizarov SPbSU 2012
  • 21. 3D acceleration 21 Egor Elizarov SPbSU 2012
  • 22. 2D acceleration 22 Egor Elizarov SPbSU 2012
  • 23. HAL/kernel interaction 23 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
  • 25. HWComposer (Omap4) 25 Egor Elizarov SPbSU 2012
  • 26. Emulator GL acceleration  In ICS Android team added GL acceleration for Emulator  Emulator uses x86 host GL acceleration relying on host hardware accelerated libraries 26 Egor Elizarov SPbSU 2012
  • 27. Android-emulator approach 27 Egor Elizarov SPbSU 2012
  • 28. Android-x86 approach 28 Egor Elizarov SPbSU 2012
  • 29. Next Time  System start up  Media subsystem 29 Egor Elizarov SPbSU 2012
  • 30. Useful links  http://vk.com/android_internals  http://www.slideshare.net/jserv/design-and-concepts-of-android- graphics  http://people.debian.org.tw/~olv/surfaceflinger/surfaceflinger.pdf  http://www.cnblogs.com/xl19862005/archive/2011/11/17/22153 63.html  Http://www.khronos.org  https://plus.google.com/105051985738280261832/posts/2FXDC z8x93s 30 Egor Elizarov SPbSU 2012
  • 31. Useful links (2)  http://www.ti.com/lit/wp/swpy027/swpy027.pdf  http://www.freescale.com/files/ftf_2010/Americas/FTF10_FT F-ENT-F0824.pdf  http://elinux.org/images/0/02/Android_Platform_Optimization s_SNPS_20111027.pdf  http://android-developers.blogspot.com/2011/02/introducing- renderscript.html  http://android- developers.blogspot.com/2011/03/renderscript.html 31 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