Hardware Acceleration on Mobile, Ariya Hidayat & Jarred Nicholls

Sencha
SenchaSencha
Wednesday, November 2, 11
Wednesday, November 2, 11
Hardware Acceleration
                on Mobile
                              Ariya Hidayat & Jarred Nicholls
                                         Sencha




                            Twitter: @ariyahidayat   @jarrednicholls

Wednesday, November 2, 11
Challenges




Wednesday, November 2, 11
Game vs Web




Wednesday, November 2, 11
Game
                                                         Text




                                                                Textured
                                                                 objects
                       Animation




                              Transformation   Physics




Wednesday, November 2, 11
Web Pages


                                   Images

                            Text




Wednesday, November 2, 11
How Browser Works

                             Network stack




                                         Layout engine



                            JavaScript engine            Graphics




                                                User interface




Wednesday, November 2, 11
WebKit Components

                            DOM               CSS


                                  WebCore              SVG


                    HTML
                                        rendering

                                                             JavaScriptCore



                                      WebKit Library




Wednesday, November 2, 11
Platform Abstraction

                            Network     Unicode      Clipboard


                            Graphics     Theme        Events


                            Thread     Geolocation    Timer




Wednesday, November 2, 11
Graphics Abstraction

       GraphicsContext          Mac        Chromium       Qt     Gtk


                                             Skia
                            CoreGraphics
                                                      QPainter


                                                graphics stack




Wednesday, November 2, 11
Components of Mobile

                                              Radio




                            Touch interface


                                                      CPU

                                  Power


                                               GPU



Wednesday, November 2, 11
Graphics Processor

                            Divide and conquer




                            Very specific purpose




Wednesday, November 2, 11
Optimized for Games


                            Fixed geometry

                            Transformation

                            Textured triangles



                                    Parallelism

Wednesday, November 2, 11
Challenges



         Predictable contents (assets)   ✔
         Mostly text                           ✔
         Mostly images                   ✔
          Expected run-time response         immediate



Wednesday, November 2, 11
Primitive Drawing




Wednesday, November 2, 11
Path is Everything



                               Triangle   Rectangle




                        Path
                               Ellipse         Polygon


Wednesday, November 2, 11
Stroke = Outline




                  Solid     Dashed   Dotted   Textured


Wednesday, November 2, 11
Brush = Fill




            None            Solid   Gradient   Textured




Wednesday, November 2, 11
Smooth via Antialiasing
                            Multiple levels of transparency




                                         Perfect for parallelism


Wednesday, November 2, 11
Path Approximation
                  Curves




                            Polygon




Wednesday, November 2, 11
Gradient: Expensive
                            CPU: sequential, tedious




                            GPU: parallel, still a lot of work

Wednesday, November 2, 11
Blur Shadow: Really Posh
                            Involved pixel “blending”




                            GPU: parallel, still tedious

Wednesday, November 2, 11
Transformation




                 Scaling
                                       Perspective
                            Rotation




Wednesday, November 2, 11
Text Rasterization




Wednesday, November 2, 11
Font Atlas
                            Buffer




                                     Bye




Wednesday, November 2, 11
Simple to Complex

                                                  ello!
                                                H


           Simple shape                         Curves
            Solid color                     Gradient brush
                                            Textured stroke
                                             Blur shadow
                            Make it as an      Serif text
                              image            Rotated
Wednesday, November 2, 11
HOW FAST?




Wednesday, November 2, 11
Android Drawing

                                                   Log file
                   WebCore
                   graphics


                              GraphicsContext



                                            Skia




Wednesday, November 2, 11
Example: Bing
    platformInit
    savePlatformState
    translate 0,0
    translate 0,0
    clip 1,0 0x6.95322e-310
    fillRect 0,0 800x556 color   ff ff ff ff
    restorePlatformState
    platformDestroy
    platformInit
    savePlatformState
    translate 0,0
    translate 0,0
    clip 1,0 0x6.95322e-310
    fillRect 0,0 800x556 color   ff ff ff ff
    restorePlatformState
    platformDestroy
    platformInit
    savePlatformState
    translate 0,0
    translate 0,0
    clip 1,0 0x6.95322e-310
    fillRect 0,0 800x556 color   ff ff ff ff
    fillRect 0,0 800x556 color   ff ff ff ff

Wednesday, November 2, 11
How Fast?

              #include "TimeCounter.h"


              bool WebViewCore::drawContent(SkCanvas* canvas, SkColor)
              {
                  uint32_t timestamp = getThreadMsec();

                       .... painting code ....

                       DBG_SET_LOGD("% ms", getThreadMsec() - timestamp);
              }




                            external/webkit/WebKit/android/jni/WebViewCore.cpp

Wednesday, November 2, 11
Example: Google News

         adb logcat -v time | grep drawContent
        16:24:04.070 D/webcoreglue(  273): drawContent   11   ms
        16:24:04.110 D/webcoreglue(  273): drawContent   13   ms
        16:24:04.150 D/webcoreglue(  273): drawContent   13   ms
        16:24:04.190 D/webcoreglue(  273): drawContent   10   ms
        16:24:04.240 D/webcoreglue(  273): drawContent   10   ms
        16:24:04.280 D/webcoreglue(  273): drawContent   13   ms
        16:24:04.320 D/webcoreglue(  273): drawContent   13   ms
        16:24:04.360 D/webcoreglue(  273): drawContent   13   ms
        16:24:06.080 D/webcoreglue(  273): drawContent   12   ms
        16:24:06.140 D/webcoreglue(  273): drawContent   10   ms
        16:24:06.180 D/webcoreglue(  273): drawContent   13   ms
        16:24:06.230 D/webcoreglue(  273): drawContent   14   ms
        16:24:06.600 D/webcoreglue(  273): drawContent   26   ms
        16:24:06.640 D/webcoreglue(  273): drawContent   13   ms
        16:24:06.860 D/webcoreglue(  273): drawContent   33   ms
        16:24:06.890 D/webcoreglue(  273): drawContent   12   ms
        16:24:06.930 D/webcoreglue(  273): drawContent   13   ms
        16:24:06.960 D/webcoreglue(  273): drawContent   13   ms
        16:24:07.000 D/webcoreglue(  273): drawContent   13   ms


Wednesday, November 2, 11
Backing Store




Wednesday, November 2, 11
Maps

                            Tile




Wednesday, November 2, 11
Pinch to Zoom




         when you pinch...




Wednesday, November 2, 11
Responsive UI

                                           decoupled
                     Rendering

                             Processor

                                    User interaction


Wednesday, November 2, 11
Rendering vs Interaction

                                                      Screen
                              Backing Store
                  Rendering




    Web Page                                  User interaction




Wednesday, November 2, 11
Checkerboard Pattern




Wednesday, November 2, 11
Progressive Rendering
                    Fast but blurry




                                      Crisp but slow


Wednesday, November 2, 11
Tiling System



                                   Texture upload


                            ....               ....



                   CPU                                GPU


Wednesday, November 2, 11
Tile Transformation




           Panning = Translation   Zooming = Scaling

Wednesday, November 2, 11
Backing Store Support


       Vector-based




       Texture-based
                            Honeycomb and later

Wednesday, November 2, 11
Y U NO
                            position:fixed




Wednesday, November 2, 11
Demo




Wednesday, November 2, 11
Layer & Compositing




Wednesday, November 2, 11
Elements = Layers




Wednesday, November 2, 11
Typical Animation




                            opacity, movement, scaling, rotation, ...

Wednesday, November 2, 11
Immediate Mode


                            setInterval(function() {
                                box.draw(x, y);
                                x += 10;
                            }, 20);


                                              every animation tick




Wednesday, November 2, 11
Scene Graph


             box.drawInto(layer);
             setInterval(function() {
                 layer.translate(10, 0);   Change transformation
                                                  matrix
             }, 20);




Wednesday, November 2, 11
Logical 3-D




Wednesday, November 2, 11
Keep the Textures




Wednesday, November 2, 11
Demo




Wednesday, November 2, 11
Compositing Support




                            Honeycomb and later




Wednesday, November 2, 11
Well-known Trick

                                                      forcing 3-D transform



                            -webkit-transform: translateZ(0)




                                Not needed for CSS animation!



Wednesday, November 2, 11
Debugging in Safari

             defaults write com.apple.Safari IncludeInternalDebugMenu




Wednesday, November 2, 11
Compositing Indicators

                            Texture (number = upload)


                                         Composited layer




                            No texture

                                          Container layer


                                             Overflow




Wednesday, November 2, 11
Debugging in Chrome

                  about:flags




Wednesday, November 2, 11
Avoid Texture Reupload

                            No reupload                          Upload




                             Opacity                     Everything else!
                             Position
                              Size
                            Animation


                                    “Hardware accelerated CSS”

Wednesday, November 2, 11
Avoid Overcapacity




                              GPU = Limited silicon space
                            Large layer ➔ broken into “tiles”
Wednesday, November 2, 11
Prepare & Reuse




                                       Hide the layer offscreen




                            Viewport
Wednesday, November 2, 11
Wrap Up




Wednesday, November 2, 11
Hardware Acceleration




                Drawing     Backing     Layer &
               primitives    stores   compositing


Wednesday, November 2, 11
THANK YOU!




Wednesday, November 2, 11
QUESTIONS?


            ariya @ sencha.com             jarred @ sencha.com



                 ariya.ofilabs.com


                            ariyahidayat   jarrednicholls



Wednesday, November 2, 11
1 of 64

Recommended

SIGGRAPH 2012: NVIDIA OpenGL for 2012 by
SIGGRAPH 2012: NVIDIA OpenGL for 2012SIGGRAPH 2012: NVIDIA OpenGL for 2012
SIGGRAPH 2012: NVIDIA OpenGL for 2012Mark Kilgard
13K views124 slides
GTC 2012: GPU-Accelerated Path Rendering by
GTC 2012: GPU-Accelerated Path RenderingGTC 2012: GPU-Accelerated Path Rendering
GTC 2012: GPU-Accelerated Path Rendering Mark Kilgard
2K views76 slides
GTC 2012: NVIDIA OpenGL in 2012 by
GTC 2012: NVIDIA OpenGL in 2012GTC 2012: NVIDIA OpenGL in 2012
GTC 2012: NVIDIA OpenGL in 2012Mark Kilgard
4.4K views81 slides
SIGGRAPH Asia 2012: GPU-accelerated Path Rendering by
SIGGRAPH Asia 2012: GPU-accelerated Path RenderingSIGGRAPH Asia 2012: GPU-accelerated Path Rendering
SIGGRAPH Asia 2012: GPU-accelerated Path RenderingMark Kilgard
3K views56 slides
Understanding Hardware Acceleration on Mobile Browsers by
Understanding Hardware Acceleration on Mobile BrowsersUnderstanding Hardware Acceleration on Mobile Browsers
Understanding Hardware Acceleration on Mobile BrowsersAriya Hidayat
17.1K views67 slides
CS 354 GPU Architecture by
CS 354 GPU ArchitectureCS 354 GPU Architecture
CS 354 GPU ArchitectureMark Kilgard
2.9K views61 slides

More Related Content

Similar to Hardware Acceleration on Mobile, Ariya Hidayat & Jarred Nicholls

Fast & Furious: Speed in the Opera browser by
Fast & Furious: Speed in the Opera browserFast & Furious: Speed in the Opera browser
Fast & Furious: Speed in the Opera browserAndreas Bovens
6.5K views51 slides
Mapnik2 Performance, September 2011 by
Mapnik2 Performance, September 2011Mapnik2 Performance, September 2011
Mapnik2 Performance, September 2011Development Seed
1.3K views25 slides
Building Sencha Themes by
Building Sencha ThemesBuilding Sencha Themes
Building Sencha ThemesSencha
6.2K views58 slides
Java Tech & Tools | Big Blobs: Moving Big Data In and Out of the Cloud | Adri... by
Java Tech & Tools | Big Blobs: Moving Big Data In and Out of the Cloud | Adri...Java Tech & Tools | Big Blobs: Moving Big Data In and Out of the Cloud | Adri...
Java Tech & Tools | Big Blobs: Moving Big Data In and Out of the Cloud | Adri...JAX London
1.1K views27 slides
Accessing Native APIs from Touch by
Accessing Native APIs from TouchAccessing Native APIs from Touch
Accessing Native APIs from TouchSencha
5.2K views52 slides
Community Code: Xero by
Community Code: XeroCommunity Code: Xero
Community Code: XeroSencha
1.1K views32 slides

Similar to Hardware Acceleration on Mobile, Ariya Hidayat & Jarred Nicholls(20)

Fast & Furious: Speed in the Opera browser by Andreas Bovens
Fast & Furious: Speed in the Opera browserFast & Furious: Speed in the Opera browser
Fast & Furious: Speed in the Opera browser
Andreas Bovens6.5K views
Mapnik2 Performance, September 2011 by Development Seed
Mapnik2 Performance, September 2011Mapnik2 Performance, September 2011
Mapnik2 Performance, September 2011
Development Seed1.3K views
Building Sencha Themes by Sencha
Building Sencha ThemesBuilding Sencha Themes
Building Sencha Themes
Sencha6.2K views
Java Tech & Tools | Big Blobs: Moving Big Data In and Out of the Cloud | Adri... by JAX London
Java Tech & Tools | Big Blobs: Moving Big Data In and Out of the Cloud | Adri...Java Tech & Tools | Big Blobs: Moving Big Data In and Out of the Cloud | Adri...
Java Tech & Tools | Big Blobs: Moving Big Data In and Out of the Cloud | Adri...
JAX London1.1K views
Accessing Native APIs from Touch by Sencha
Accessing Native APIs from TouchAccessing Native APIs from Touch
Accessing Native APIs from Touch
Sencha5.2K views
Community Code: Xero by Sencha
Community Code: XeroCommunity Code: Xero
Community Code: Xero
Sencha1.1K views
Cloud9 IDE Talk at meet.js Poznań by zefhemel
Cloud9 IDE Talk at meet.js PoznańCloud9 IDE Talk at meet.js Poznań
Cloud9 IDE Talk at meet.js Poznań
zefhemel1.1K views
Sencha Animator by Sencha
Sencha AnimatorSencha Animator
Sencha Animator
Sencha915 views
soft-shake.ch - Data grids and Data Grids by soft-shake.ch
soft-shake.ch - Data grids and Data Gridssoft-shake.ch - Data grids and Data Grids
soft-shake.ch - Data grids and Data Grids
soft-shake.ch541 views
Municipal Government Meets NoSQL by MongoDB
Municipal Government Meets NoSQLMunicipal Government Meets NoSQL
Municipal Government Meets NoSQL
MongoDB643 views
WebGL Fundamentals by Sencha
WebGL FundamentalsWebGL Fundamentals
WebGL Fundamentals
Sencha4.1K views
Ext GWT 3.0 Theming and Appearances by Sencha
Ext GWT 3.0 Theming and AppearancesExt GWT 3.0 Theming and Appearances
Ext GWT 3.0 Theming and Appearances
Sencha4.9K views
What's new in HTML5, CSS3 and JavaScript, James Pearce by Sencha
What's new in HTML5, CSS3 and JavaScript, James PearceWhat's new in HTML5, CSS3 and JavaScript, James Pearce
What's new in HTML5, CSS3 and JavaScript, James Pearce
Sencha3.8K views
ネットゲームつくろうぜ on Unity by Shinsuke Sugita
ネットゲームつくろうぜ on Unityネットゲームつくろうぜ on Unity
ネットゲームつくろうぜ on Unity
Shinsuke Sugita12.4K views
PHP Server-side Breakout by Sencha
PHP Server-side BreakoutPHP Server-side Breakout
PHP Server-side Breakout
Sencha1.8K views
Community Code: The TouchForums App by Sencha
Community Code: The TouchForums AppCommunity Code: The TouchForums App
Community Code: The TouchForums App
Sencha2.8K views
Devon 2011-f-4-improve your-javascript by Daum DNA
Devon 2011-f-4-improve your-javascriptDevon 2011-f-4-improve your-javascript
Devon 2011-f-4-improve your-javascript
Daum DNA684 views

More from Sencha

Breathe New Life into Your Existing JavaScript Applications with Web Components by
Breathe New Life into Your Existing JavaScript Applications with Web ComponentsBreathe New Life into Your Existing JavaScript Applications with Web Components
Breathe New Life into Your Existing JavaScript Applications with Web ComponentsSencha
494 views23 slides
Ext JS 6.6 Highlights by
Ext JS 6.6 HighlightsExt JS 6.6 Highlights
Ext JS 6.6 HighlightsSencha
478 views12 slides
Sencha Roadshow 2017: BufferedStore Internals featuring eyeworkers interactiv... by
Sencha Roadshow 2017: BufferedStore Internals featuring eyeworkers interactiv...Sencha Roadshow 2017: BufferedStore Internals featuring eyeworkers interactiv...
Sencha Roadshow 2017: BufferedStore Internals featuring eyeworkers interactiv...Sencha
1.1K views41 slides
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd by
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd Sencha
1.1K views41 slides
Sencha Roadshow 2017: Best Practices for Implementing Continuous Web App Testing by
Sencha Roadshow 2017: Best Practices for Implementing Continuous Web App TestingSencha Roadshow 2017: Best Practices for Implementing Continuous Web App Testing
Sencha Roadshow 2017: Best Practices for Implementing Continuous Web App TestingSencha
569 views18 slides
Sencha Roadshow 2017: What's New in Sencha Test by
Sencha Roadshow 2017: What's New in Sencha TestSencha Roadshow 2017: What's New in Sencha Test
Sencha Roadshow 2017: What's New in Sencha TestSencha
593 views38 slides

More from Sencha(20)

Breathe New Life into Your Existing JavaScript Applications with Web Components by Sencha
Breathe New Life into Your Existing JavaScript Applications with Web ComponentsBreathe New Life into Your Existing JavaScript Applications with Web Components
Breathe New Life into Your Existing JavaScript Applications with Web Components
Sencha494 views
Ext JS 6.6 Highlights by Sencha
Ext JS 6.6 HighlightsExt JS 6.6 Highlights
Ext JS 6.6 Highlights
Sencha478 views
Sencha Roadshow 2017: BufferedStore Internals featuring eyeworkers interactiv... by Sencha
Sencha Roadshow 2017: BufferedStore Internals featuring eyeworkers interactiv...Sencha Roadshow 2017: BufferedStore Internals featuring eyeworkers interactiv...
Sencha Roadshow 2017: BufferedStore Internals featuring eyeworkers interactiv...
Sencha1.1K views
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd by Sencha
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd
Sencha Roadshow 2017: Build Progressive Web Apps with Ext JS and Cmd
Sencha1.1K views
Sencha Roadshow 2017: Best Practices for Implementing Continuous Web App Testing by Sencha
Sencha Roadshow 2017: Best Practices for Implementing Continuous Web App TestingSencha Roadshow 2017: Best Practices for Implementing Continuous Web App Testing
Sencha Roadshow 2017: Best Practices for Implementing Continuous Web App Testing
Sencha569 views
Sencha Roadshow 2017: What's New in Sencha Test by Sencha
Sencha Roadshow 2017: What's New in Sencha TestSencha Roadshow 2017: What's New in Sencha Test
Sencha Roadshow 2017: What's New in Sencha Test
Sencha593 views
Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc... by Sencha
Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...
Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...
Sencha507 views
Sencha Roadshow 2017: Modernizing the Ext JS Class System and Tooling by Sencha
Sencha Roadshow 2017: Modernizing the Ext JS Class System and ToolingSencha Roadshow 2017: Modernizing the Ext JS Class System and Tooling
Sencha Roadshow 2017: Modernizing the Ext JS Class System and Tooling
Sencha1.1K views
Sencha Roadshow 2017: Sencha Best Practices: Coworkee App by Sencha
Sencha Roadshow 2017: Sencha Best Practices: Coworkee App Sencha Roadshow 2017: Sencha Best Practices: Coworkee App
Sencha Roadshow 2017: Sencha Best Practices: Coworkee App
Sencha1.7K views
Sencha Roadshow 2017: Mobile First or Desktop First by Sencha
Sencha Roadshow 2017: Mobile First or Desktop FirstSencha Roadshow 2017: Mobile First or Desktop First
Sencha Roadshow 2017: Mobile First or Desktop First
Sencha570 views
Sencha Roadshow 2017: Innovations in Ext JS 6.5 and Beyond by Sencha
Sencha Roadshow 2017: Innovations in Ext JS 6.5 and BeyondSencha Roadshow 2017: Innovations in Ext JS 6.5 and Beyond
Sencha Roadshow 2017: Innovations in Ext JS 6.5 and Beyond
Sencha1.7K views
Leveraging React and GraphQL to Create a Performant, Scalable Data Grid by Sencha
Leveraging React and GraphQL to Create a Performant, Scalable Data GridLeveraging React and GraphQL to Create a Performant, Scalable Data Grid
Leveraging React and GraphQL to Create a Performant, Scalable Data Grid
Sencha843 views
Learn Key Insights from The State of Web Application Testing Research Report by Sencha
Learn Key Insights from The State of Web Application Testing Research ReportLearn Key Insights from The State of Web Application Testing Research Report
Learn Key Insights from The State of Web Application Testing Research Report
Sencha446 views
Introducing ExtReact: Adding Powerful Sencha Components to React Apps by Sencha
Introducing ExtReact: Adding Powerful Sencha Components to React AppsIntroducing ExtReact: Adding Powerful Sencha Components to React Apps
Introducing ExtReact: Adding Powerful Sencha Components to React Apps
Sencha1.1K views
SenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark Brocato by Sencha
SenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark BrocatoSenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark Brocato
SenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark Brocato
Sencha1.6K views
SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly... by Sencha
SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...
SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...
Sencha1.8K views
SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou... by Sencha
SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...
SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...
Sencha810 views
SenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web Apps by Sencha
SenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web AppsSenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web Apps
SenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web Apps
Sencha676 views
Ext JS Architecture Best Practices - Mitchell Simeons by Sencha
Ext JS Architecture Best Practices - Mitchell SimeonsExt JS Architecture Best Practices - Mitchell Simeons
Ext JS Architecture Best Practices - Mitchell Simeons
Sencha3.4K views
SenchaCon 2016: Mobile First? Desktop First? Or Should you Think Universal Ap... by Sencha
SenchaCon 2016: Mobile First? Desktop First? Or Should you Think Universal Ap...SenchaCon 2016: Mobile First? Desktop First? Or Should you Think Universal Ap...
SenchaCon 2016: Mobile First? Desktop First? Or Should you Think Universal Ap...
Sencha561 views

Recently uploaded

iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas... by
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...Bernd Ruecker
37 views69 slides
Uni Systems for Power Platform.pptx by
Uni Systems for Power Platform.pptxUni Systems for Power Platform.pptx
Uni Systems for Power Platform.pptxUni Systems S.M.S.A.
56 views21 slides
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ... by
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...Jasper Oosterveld
18 views49 slides
Mini-Track: Challenges to Network Automation Adoption by
Mini-Track: Challenges to Network Automation AdoptionMini-Track: Challenges to Network Automation Adoption
Mini-Track: Challenges to Network Automation AdoptionNetwork Automation Forum
12 views27 slides
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N... by
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...James Anderson
85 views32 slides

Recently uploaded(20)

iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas... by Bernd Ruecker
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
Bernd Ruecker37 views
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ... by Jasper Oosterveld
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N... by James Anderson
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
James Anderson85 views
Data Integrity for Banking and Financial Services by Precisely
Data Integrity for Banking and Financial ServicesData Integrity for Banking and Financial Services
Data Integrity for Banking and Financial Services
Precisely21 views
Special_edition_innovator_2023.pdf by WillDavies22
Special_edition_innovator_2023.pdfSpecial_edition_innovator_2023.pdf
Special_edition_innovator_2023.pdf
WillDavies2217 views
Empathic Computing: Delivering the Potential of the Metaverse by Mark Billinghurst
Empathic Computing: Delivering  the Potential of the MetaverseEmpathic Computing: Delivering  the Potential of the Metaverse
Empathic Computing: Delivering the Potential of the Metaverse
Mark Billinghurst478 views
Igniting Next Level Productivity with AI-Infused Data Integration Workflows by Safe Software
Igniting Next Level Productivity with AI-Infused Data Integration Workflows Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Safe Software263 views
Attacking IoT Devices from a Web Perspective - Linux Day by Simone Onofri
Attacking IoT Devices from a Web Perspective - Linux Day Attacking IoT Devices from a Web Perspective - Linux Day
Attacking IoT Devices from a Web Perspective - Linux Day
Simone Onofri16 views
STPI OctaNE CoE Brochure.pdf by madhurjyapb
STPI OctaNE CoE Brochure.pdfSTPI OctaNE CoE Brochure.pdf
STPI OctaNE CoE Brochure.pdf
madhurjyapb14 views
Case Study Copenhagen Energy and Business Central.pdf by Aitana
Case Study Copenhagen Energy and Business Central.pdfCase Study Copenhagen Energy and Business Central.pdf
Case Study Copenhagen Energy and Business Central.pdf
Aitana16 views

Hardware Acceleration on Mobile, Ariya Hidayat & Jarred Nicholls

  • 3. Hardware Acceleration on Mobile Ariya Hidayat & Jarred Nicholls Sencha Twitter: @ariyahidayat @jarrednicholls Wednesday, November 2, 11
  • 5. Game vs Web Wednesday, November 2, 11
  • 6. Game Text Textured objects Animation Transformation Physics Wednesday, November 2, 11
  • 7. Web Pages Images Text Wednesday, November 2, 11
  • 8. How Browser Works Network stack Layout engine JavaScript engine Graphics User interface Wednesday, November 2, 11
  • 9. WebKit Components DOM CSS WebCore SVG HTML rendering JavaScriptCore WebKit Library Wednesday, November 2, 11
  • 10. Platform Abstraction Network Unicode Clipboard Graphics Theme Events Thread Geolocation Timer Wednesday, November 2, 11
  • 11. Graphics Abstraction GraphicsContext Mac Chromium Qt Gtk Skia CoreGraphics QPainter graphics stack Wednesday, November 2, 11
  • 12. Components of Mobile Radio Touch interface CPU Power GPU Wednesday, November 2, 11
  • 13. Graphics Processor Divide and conquer Very specific purpose Wednesday, November 2, 11
  • 14. Optimized for Games Fixed geometry Transformation Textured triangles Parallelism Wednesday, November 2, 11
  • 15. Challenges Predictable contents (assets) ✔ Mostly text ✔ Mostly images ✔ Expected run-time response immediate Wednesday, November 2, 11
  • 17. Path is Everything Triangle Rectangle Path Ellipse Polygon Wednesday, November 2, 11
  • 18. Stroke = Outline Solid Dashed Dotted Textured Wednesday, November 2, 11
  • 19. Brush = Fill None Solid Gradient Textured Wednesday, November 2, 11
  • 20. Smooth via Antialiasing Multiple levels of transparency Perfect for parallelism Wednesday, November 2, 11
  • 21. Path Approximation Curves Polygon Wednesday, November 2, 11
  • 22. Gradient: Expensive CPU: sequential, tedious GPU: parallel, still a lot of work Wednesday, November 2, 11
  • 23. Blur Shadow: Really Posh Involved pixel “blending” GPU: parallel, still tedious Wednesday, November 2, 11
  • 24. Transformation Scaling Perspective Rotation Wednesday, November 2, 11
  • 26. Font Atlas Buffer Bye Wednesday, November 2, 11
  • 27. Simple to Complex ello! H Simple shape Curves Solid color Gradient brush Textured stroke Blur shadow Make it as an Serif text image Rotated Wednesday, November 2, 11
  • 29. Android Drawing Log file WebCore graphics GraphicsContext Skia Wednesday, November 2, 11
  • 30. Example: Bing platformInit savePlatformState translate 0,0 translate 0,0 clip 1,0 0x6.95322e-310 fillRect 0,0 800x556 color ff ff ff ff restorePlatformState platformDestroy platformInit savePlatformState translate 0,0 translate 0,0 clip 1,0 0x6.95322e-310 fillRect 0,0 800x556 color ff ff ff ff restorePlatformState platformDestroy platformInit savePlatformState translate 0,0 translate 0,0 clip 1,0 0x6.95322e-310 fillRect 0,0 800x556 color ff ff ff ff fillRect 0,0 800x556 color ff ff ff ff Wednesday, November 2, 11
  • 31. How Fast? #include "TimeCounter.h" bool WebViewCore::drawContent(SkCanvas* canvas, SkColor) { uint32_t timestamp = getThreadMsec(); .... painting code .... DBG_SET_LOGD("% ms", getThreadMsec() - timestamp); } external/webkit/WebKit/android/jni/WebViewCore.cpp Wednesday, November 2, 11
  • 32. Example: Google News adb logcat -v time | grep drawContent 16:24:04.070 D/webcoreglue(  273): drawContent 11 ms 16:24:04.110 D/webcoreglue(  273): drawContent 13 ms 16:24:04.150 D/webcoreglue(  273): drawContent 13 ms 16:24:04.190 D/webcoreglue(  273): drawContent 10 ms 16:24:04.240 D/webcoreglue(  273): drawContent 10 ms 16:24:04.280 D/webcoreglue(  273): drawContent 13 ms 16:24:04.320 D/webcoreglue(  273): drawContent 13 ms 16:24:04.360 D/webcoreglue(  273): drawContent 13 ms 16:24:06.080 D/webcoreglue(  273): drawContent 12 ms 16:24:06.140 D/webcoreglue(  273): drawContent 10 ms 16:24:06.180 D/webcoreglue(  273): drawContent 13 ms 16:24:06.230 D/webcoreglue(  273): drawContent 14 ms 16:24:06.600 D/webcoreglue(  273): drawContent 26 ms 16:24:06.640 D/webcoreglue(  273): drawContent 13 ms 16:24:06.860 D/webcoreglue(  273): drawContent 33 ms 16:24:06.890 D/webcoreglue(  273): drawContent 12 ms 16:24:06.930 D/webcoreglue(  273): drawContent 13 ms 16:24:06.960 D/webcoreglue(  273): drawContent 13 ms 16:24:07.000 D/webcoreglue(  273): drawContent 13 ms Wednesday, November 2, 11
  • 34. Maps Tile Wednesday, November 2, 11
  • 35. Pinch to Zoom when you pinch... Wednesday, November 2, 11
  • 36. Responsive UI decoupled Rendering Processor User interaction Wednesday, November 2, 11
  • 37. Rendering vs Interaction Screen Backing Store Rendering Web Page User interaction Wednesday, November 2, 11
  • 39. Progressive Rendering Fast but blurry Crisp but slow Wednesday, November 2, 11
  • 40. Tiling System Texture upload .... .... CPU GPU Wednesday, November 2, 11
  • 41. Tile Transformation Panning = Translation Zooming = Scaling Wednesday, November 2, 11
  • 42. Backing Store Support Vector-based Texture-based Honeycomb and later Wednesday, November 2, 11
  • 43. Y U NO position:fixed Wednesday, November 2, 11
  • 47. Typical Animation opacity, movement, scaling, rotation, ... Wednesday, November 2, 11
  • 48. Immediate Mode setInterval(function() {     box.draw(x, y);     x += 10; }, 20); every animation tick Wednesday, November 2, 11
  • 49. Scene Graph box.drawInto(layer); setInterval(function() {     layer.translate(10, 0); Change transformation matrix }, 20); Wednesday, November 2, 11
  • 53. Compositing Support Honeycomb and later Wednesday, November 2, 11
  • 54. Well-known Trick forcing 3-D transform -webkit-transform: translateZ(0) Not needed for CSS animation! Wednesday, November 2, 11
  • 55. Debugging in Safari defaults write com.apple.Safari IncludeInternalDebugMenu Wednesday, November 2, 11
  • 56. Compositing Indicators Texture (number = upload) Composited layer No texture Container layer Overflow Wednesday, November 2, 11
  • 57. Debugging in Chrome about:flags Wednesday, November 2, 11
  • 58. Avoid Texture Reupload No reupload Upload Opacity Everything else! Position Size Animation “Hardware accelerated CSS” Wednesday, November 2, 11
  • 59. Avoid Overcapacity GPU = Limited silicon space Large layer ➔ broken into “tiles” Wednesday, November 2, 11
  • 60. Prepare & Reuse Hide the layer offscreen Viewport Wednesday, November 2, 11
  • 62. Hardware Acceleration Drawing Backing Layer & primitives stores compositing Wednesday, November 2, 11
  • 64. QUESTIONS? ariya @ sencha.com jarred @ sencha.com ariya.ofilabs.com ariyahidayat jarrednicholls Wednesday, November 2, 11