SlideShare a Scribd company logo
Hardware Accelerated 2D
     Rendering for Android



Jim Huang ( 黃敬群 ) <jserv@0xlab.org>
Developer, 0xlab
                       Feb 19, 2013 / Android Builders Summit
Rights to copy
                                                                   © Copyright 2013 0xlab
                                                                          http://0xlab.org/
                                                                           contact@0xlab.org
Attribution – ShareAlike 3.0
                                               Corrections, suggestions, contributions and translations
You are free                                                                             are welcome!
   to copy, distribute, display, and perform the work
   to make derivative works                                               Latest update: Feb 19, 2013
   to make commercial use of the work
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.
   For any reuse or distribution, you must make clear to others the license terms of this work.
   Any of these conditions can be waived if you get permission from the copyright holder.
Your fair use and other rights are in no way affected by the above.
License text: http://creativecommons.org/licenses/by-sa/3.0/legalcode
Agenda   (1) Concepts
         (2) Performance Problems
         (3) Hardware Accelerating
            Case study: skia, webkit
Concepts
Graphic Toolkit, Rendering, GPU operations
Revise what you saw on Android
Exporting Graphics
• can be exported from any of the levels of the graphics stack
   – Application, Graphic Toolkit, Graphic Rendering, Bitmapped Device
Exporting Graphics - Application
• Normal way Linux/Android/Iphone runs apps.
   – The application itself is exported and run locally.
Exporting Graphics - Toolkit
• Technically very complex. Android has 15 different toolkit API variants.
• Every application can extend the toolkit with custom widgets
  (subclasses of android.view.View).




             Exporting Graphics - Rendering
• Exports graphics at the rendering level.
• In Android there are a number of rendering interfaces that can be used:
   – skia graphics
   – OpenGL ES 1.1 or OpenGL ES 2.0
   – Android.view.View
2D Graphics
• The display presents us the contents of something called the
  framebuffer.
• The framebuffer is an area in (V)RAM
• For each pixel on screen there‘s a corresponding memory cell in the
  framebuffer
• Pixels are addressed with 2D coordinates.
2D Graphics
• To change what is displayed → change the colors of pixels in (V)RAM.
   – Pixel colors are encoded as RGB or RGBA
• To draw shapes → need to figure out which framebuffer pixels we have
  to set.
   – Images (bitmaps) are not special either
   – Pixels of the bitmap get stored in a memory area, just like we store
     framebuffer pixels.
• To draw a bitmap to the framebuffer → copy the pixels. (Blitting)
• We can perform the same operations on bitmaps as we perform on the
  framebuffer, e.g. draw shapes or other bitmaps.
Blitting: copy (parts of) one bitmap to another




 Alpha Compositing: blitting + alpha blending
                                              •   Alpha value of a pixel
                                                  governs transparency
                                              •   Instead of overwritting a
                                                  destination pixel we mix its
                                                  color with the source pixel.




Source: Android Game Development 101, BadlogicGames
Source: Android Game Development 101, BadlogicGames
Android Graphics Stack
Rendering Level: skia

• The rendering level is the graphics layer that
  actually “colors” the pixels in the bitmap.
• skia is a compact open source graphics library
  written in C++.
• Currently used in Google Chrome, Chrome OS,
  and Android.




      Skia is Greek for “shadow”
      Skia is Greek for “shadow”
Rendering Level: skia

• skia is a complete 2D graphic library for drawing
  Text, Geometries, and Images. Features include:
   – 3x3 matrices w/ perspective
   – Antialiasing, transparency, filters
   – Shaders, xfermodes, maskfilters, patheffects
Rendering Level: skia

• Each skia call has two components:
   – the primitive being drawing
    (SkRect, SkPath, etc.)
  – color/style attributes (SkPaint)
• Usage example:
canvas.save();
canvas.rotate(45);
canvas.drawRect(rect, paint);
canvas.drawText(“abc”, 3, x, y, paint);
canvas.restore();
WebKit in Android

               event
WebCore                   Refresh the surface
                          (expose event)


                        Android.webkit.WebViewCore
                          android.webkit.WebView
          Skia bridge                ...

      WebKit
                          skia
                          skia                  JNI
 v8                                             JNI
                        skia-gpu
                        skia-gpu

                                      Surface
                                      Surface
CPU vs. GPU Limited at Rendering
                           Tasks over Time
 100%                                                                                      100%

  90%                                                                                      90%

  80%                                                                                      80%

  70%                                                                                      70%

  60%                                                                                      60%

  50%                                                                                GPU   50%                                                                                 GPU
                                                                                     CPU                                                                                       CPU
  40%                                                                                      40%

  30%                                                                                      30%

  20%                                                                                      20%

  10%                                                                                      10%

   0%                                                                                       0%
        1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012                1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012



        Pipelined 3D Interactive Rendering                                                                              Path Rendering

 Goal of NV_path_rendering is to make path rendering a GPU-limited task
 Render all interactive pixels, whether 3D or 2D or web content with the GPU


Source: GPU-Accelerated 2D and Web Rendering, Mark Kilgard, NVIDIA
Source: GPU-Accelerated 2D and Web Rendering, Mark Kilgard, NVIDIA
Rendering Paths
             [ skia + gpu; Chrome browser ]
JavaScript
 (Canvas)       OpenGL ES         CPU        GPU



                                Computing
 Draw Call        Draw Call      Context

                                Computing
 Draw Call        Draw Call      Context

                                Computing
 Draw Call        Draw Call      Context

                                        ck
                                   lene
                                Computing    Flush
                              Bott
 Draw Call        Draw Call      Context




                                Computing
 Draw Call        Draw Call      Context
Rendering Paths
                                                   [ ideal case ]
JavaScript
 (Canvas)    GL request   OpenGL ES       CPU         GPU
             Optimizer


Draw Call


Draw Call


Draw Call
                             Draw      Computing
Draw Call                    Call       Context       Flush




Draw Call
skia + gpu

   • Problems
         – calls glDrawSomethings too many times
         – changes gl states too many times
         – switches FBO too many times
         – vector graphics APIs and shadows are really slow
   • Increases dramatically CPU overhead

   Draw Call At Once         Ideal GL   skia

      Bitmap Sprite            Good     Good


      Convex Path              Good     Poor


     Concave Path              Good     Poor


  Bitmap Sprite + Path         Good     Poor


Path + Different Shadow        Good     Poor


Text + Different Draw Call     Good     Poor
The performance problem is still
          rendering...

    Let's look into deeper.
Hardware Accelerating
How Android utilizes GPU functionalities
Myths and Facts
• Myth: Android 1.x is slow because of no
  hardware accelerations
   – NOT TRUE! window compositing utilizes
     hardware accelerations.
   – But it is quite constrained
• There are 4 Window: Status Bar, Wallpaper,
  Launcher, and Menu in the right screenshot.
   – Hardware composites animations of Activity
     transition, the fading in/out of Menu.
• However, the content of Window (Canvas) is
  being accelerated by hardware since Android 3.x
View & TextureView

• View
  – represents the basic building block for UI
  – occupies a rectangular area on the screen and is
    responsible for drawing and event handling.

• SurfaceView
  – provides a dedicated drawing surface embedded inside of
    a view hierarchy.

• TextureView
  – Since Android 4.0
  – Only activated when hardware acceleration is enabled !
  – has the same property of SurfaceView, but you can create
    GL surface and perform GL rendering above them.
from EGL to SurfaceFlinger


 hardware
 hardware    android software
              android software
OpenGL|ES
OpenGL|ES   OpenGL|ES renderer
            OpenGL|ES renderer
Case study: skia
 Paint, Canvas, Backend
skia, again

Drawing basic primitives include rectangles, rounded rectangles, ovals, circles,
arcs, paths, lines, text, bitmaps and sprites. Paths allow for the creation of more
advanced shapes.

                                  Canvas encapsulates all of the state about
                                  drawing into a device (bitmap).




While Canvas holds the state of the drawing device, the state (style) of the
object being drawn is held by Paint, which is provided as a parameter to
each of the draw() methods. Paint holds attributes such as color, typeface,
textSize, strokeWidth, shader (e.g. gradients, patterns), etc.
skia rendering pipeline




Source: http://www.xenomachina.com/2011/05/androids-2d-canvas-rendering-pipeline.html
Source: http://www.xenomachina.com/2011/05/androids-2d-canvas-rendering-pipeline.html
Skia backends

• Render in software
  – create a native window and then
  – wrap a pointer to its buffer as an SkBitmap
  – Initialize an SkCanvas with the bitmap

• Render in hardware acceleration
  – create a GLES2 window or framebuffer and
  – create the appropriate GrContext, SkGpuDevice, and
    SkGpuCanvas
How Views are Drawn [Android 2.x]
Hardware-accelerated 2D Rendering
 • Since Android 3.x, more complex than before!
 • Major idea: transform the implementation of 2D Graphics
   APIs into OpenGL|ES requests
 • Texture, Shader, GLContext, pipeline, …
 • Major parts for hardware-accelerated 2D Rendering
    – Primitive Drawing: Shape, Text,Image
    – Layer/Surface Compositing
Control hardware accelerations

     • Application level
           <application android:hardwareAccelerated="true">
         – Default value
             • False in Android 3.x, True in Android 4.x
     • Activity
     • Window
        WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED
     • View
         – setLayerType(View.LAYER_TYPE_SOFTWARE,null)


View.setLayerType(int type,Paint p)
  Layers = Off-screen Buffers or Caches
  Layers = Off-screen Buffers or Caches
View Layers since Android 3.x




   Source:Accelerated Android Rendering, Google I/O 2011
   Source:Accelerated Android Rendering, Google I/O 2011
How Views are Drawn [Android 3.x]




    HardwareCanvas → SkPaint → GLRenderer
        no SkGpuCanvas/SkGpuDevice?!

      Why can't skia use its OpenGL
           backend directly?
To answer the previous question, we have to
                                                  learn Display List first
        • A display list (or display file) is a series of graphics
          commands that define an output image. The image is
          created (rendered) by executing the commands.
        • A display list can represent both two- and three-dimensional
          scenes.
        • Systems that make use of a display list to store the scene
          are called retained mode systems as opposed to immediate
          mode systems.




http://en.wikipedia.org/wiki/Display_list
http://developer.android.com/guide/topics/graphics/hardware-accel.html
Display List [Android 3.x]




• A display list records a series of graphics related operation and can replay
  them later. Display lists are usually built by recording operations on a
  android.graphics.Canvas.
• Replaying the operations from a display list avoids executing views drawing
  code on every frame, and is thus much more efficient.
Display List [Android 4.1]




   Source:For Butter or Worse, Google I/O 2012
   Source:For Butter or Worse, Google I/O 2012
Case study: webkit
      RenderObjects, RenderTree, RenderLayers,
Accelerated Compositing, Rendering Flow, Tiled Texture
WebKit Rendering

• RenderObjects
• RenderTree
• RenderLayers
WebKit Rendering – RenderObject

• Each node in the DOM tree that produces visual
  output has a corresponding RenderObject.
• RenderObjects are stored in a parallel tree
  structure, called the Render Tree.
• RenderObject knows how to present (paint) the
  contents of the Node on a display surface.
• It does so by issuing the necessary draw calls to
  the GraphicsContext associated with the page
  renderer.
   – GraphicsContext is ultimately responsible for writing the
     pixels on the bitmap that gets displayed to the screen.
WebKit Rendering – RenderTree
RenderObjects are stored in a parallel tree structure, called
Render Tree.
WebKit Rendering – RenderLayers

• Each RenderObject is associated with a
  RenderLayer either directly or indirectly via an
  ancestor RenderObject.
• RenderObjects that share the same coordinate
  space (e.g. are affected by the same CSS
  transform) typically belong to the same
  RenderLayer.
• RenderLayers exist so that the elements of the
  page are composited in the correct order to
  properly display overlapping content,
  semitransparent elements, etc.
RenderLayers

• In general a RenderObject warrants the creation of
  a RenderLayer if
   – is the root object for the page
   – has explicit CSS position properties (relative,
     absolute or a ransform)
   – is transparent
   – has overflow, an alpha mask or reflection
   – Corresponds to <canvas> element that has a 3D
     (WebGL) context Corresponds to a <video>
     element
WebKit Rendering
• RenderLayer hierarchy is traversed recursively starting from
  the root and the bulk of the work is done in
  RenderLayer::paintLayer().
• WebView is the web page encapsulated in a UI component.
• Web page update → the redraw of WebView
   – Adjust layers structure according to the latest content
     and then render/record the updated
   – Render the updated content
• Various approaches of Rendering Architecture
   – Use texture or vector (backing store) as the internal
     representation
   – multithreaded, multiple processes.
Accelerated Compositing

• Idea: to optimize for cases where an element would
  be painted to the screen multiple times without its
  content changing.
   – For example, a menu sliding into the screen, or a
     static toolbar on top of a video.
• It does so by creating a scene graph, a tree of
  objects (graphics layers), which have properties
  attached to them - transformation matrix, opacity,
  position, effects etc., and also a notification when
  the layer's content needs to be re-rendered.
• When accelerated compositing is enabled, some (but not
  all) of the RenderLayer's get their own backing surface
  (compositing layer) into which they paint instead of drawing
  directly into the common bitmap for the page.
• Compositor is responsible for applying the necessary
  transformations (as specified by the layer's CSS transform
  properties) to each layer before compositing it.
• Since painting of the layers is decoupled from compositing,
  invalidating one of these layers only results in repainting the
  contents of that layer alone and recompositing.
Rendering Flow

• Layers Sync
      → done by WebCore itself
• Layers Compositing
       → done by WebKit port (like Android)


• Android 4.x supports Accelerated Compositing and
  Hardware Accelerations
  – decided by the property of given Canvas
[ skia + gpu; Chrome browser ]
 JavaScript
  (Canvas)                     OpenGL ES          CPU            GPU



                                                Computing
   Draw Call                     Draw Call       Context

                                                Computing
   Draw Call                     Draw Call       Context

                                                Computing
   Draw Call                     Draw Call       Context

                                                      eck
                                                 ttlen
                                                Computing        Flush
   Draw Call                     Draw Call
                                              Bo Context




                                                Computing
   Draw Call                     Draw Call       Context




• When WebView is redrawn, UI thread performans compositing
  – First, TiledTexture in Root Layer of current Page ViewPort
  – Then, TiledTexture in other BackingLayers
• The generation of TiledTexture can utilize both CPU and GPU.
   – Android 4.0 still uses CPU.
Flow of Generating Tiled Texture

• Using CPU
  – Take one global SkBitmap and reset (size equals to one
    Tile)
  – Draw SkPicture → global SkBitmap
  – Memory copy from SkBitmap to Graphics Buffer of Tile

• Using GPU
  – All real rendering occurs in TextureGenerator thread
  – Draw the pre-gernated textures
    Page → vector backing store, layer → texture
Techniques to make it better
    JavaScript
     (Canvas)    GL request   OpenGL ES      CPU      GPU
                 Optimizer


    Draw Call


    Draw Call


    Draw Call
                                 Draw     Computing
    Draw Call                    Call      Context    Flush




    Draw Call



•    improve object lifetime management
•    Use GPU specific Backing store implementation
•    prefetch optimization for DOM Tree Traversal
•    improve texture sharing mechanisms
•    Eliminate the loading of U thread
SurfaceFlinger
• Android‘s window compositor
   – Each window is also a layer.
   – The layers are sorted by Z-order. The Z-order is just the layer
     type as specified in PhoneWindowManager.java.
• When adding a layer with a Z-order that is already used
  by some other layer in SurfaceFlinger‘s list of layers it is
  put on top of the layers with the same Z-order.
• Even many SurfaceFlinger rendering operations are
  inherently flat (2D), it uses OpenGL ES 1.1 for rendering
   – May be memory limited on devices with small displays
   – Copybit acceleration may be desirable for UI on some devices
     → deprecated since Android 2.3
   – It is known to improve UX with custom copybit module
(low-level) overhead
• Composition overhead
  – Android extensions such as “EGLImage from Android native
    buffer”, can employ copybit (2D) backend to further offload GPU
    → use non-linear textures for 3D applications to improve memory
    access locality

• Native ↔ Java communication overhead
  – Native code for key operations
  – Can be observed by TraceView tool

• Cache management overhead
  – range-based L1 and L2 cache functions (clean, invalidate, flush)
  – Normally uncached graphics memory is sufficient for gaming use
    cases
  – Cached buffers result in higher performance for CPU rendering
    in compositing systems
Performance Tips

• Display List is crucial to user experience, but it has
  to be scheduled properly, otherwise CPU loading
  gets high unexpectedly.
• Always verify and probe graphics system using
  Strict Mode
• When hardware acceleration is enable, prevent the
  following operations from being modified/created
  frequently:
   – Bitmap, Shape, Paint, Path
Reference

• Skia & FreeType: Android 2D Graphics Essentials,
  Kyungmin Lee, LG Electronics
• How about some Android graphics true facts? Dianne
  Hackborn (2011)
• Android 4.0 Graphics and Animations, Romain Guy &
  Chet Haase (2011)
• Learning about Android Graphics Subsystem, Bhanu
  Chetlapalli (2012)
• Service 與 Android 系統設計,宋寶華
http://0xlab.org

More Related Content

What's hot

BKK16-315 Graphics Stack Update
BKK16-315 Graphics Stack UpdateBKK16-315 Graphics Stack Update
BKK16-315 Graphics Stack Update
Linaro
 
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
National Cheng Kung University
 
Understaing Android EGL
Understaing Android EGLUnderstaing Android EGL
Understaing Android EGL
Suhan Lee
 
LCE13: Android Graphics Upstreaming
LCE13: Android Graphics UpstreamingLCE13: Android Graphics Upstreaming
LCE13: Android Graphics Upstreaming
Linaro
 
CS 354 Vector Graphics & Path Rendering
CS 354 Vector Graphics & Path RenderingCS 354 Vector Graphics & Path Rendering
CS 354 Vector Graphics & Path Rendering
Mark Kilgard
 
Flutter talkshow
Flutter talkshowFlutter talkshow
Flutter talkshow
Nhan Cao
 
OpenGLES - Graphics Programming in Android
OpenGLES - Graphics Programming in Android OpenGLES - Graphics Programming in Android
OpenGLES - Graphics Programming in Android
Arvind Devaraj
 
Android Security Internals
Android Security InternalsAndroid Security Internals
Android Security Internals
Opersys inc.
 
Embedded Android Workshop
Embedded Android WorkshopEmbedded Android Workshop
Embedded Android Workshop
Opersys inc.
 
Android Chromium Rendering Pipeline
Android Chromium Rendering PipelineAndroid Chromium Rendering Pipeline
Android Chromium Rendering PipelineHyungwook Lee
 
Overview of Android binder IPC implementation
Overview of Android binder IPC implementationOverview of Android binder IPC implementation
Overview of Android binder IPC implementationChethan Pchethan
 
"Learning AOSP" - Android Hardware Abstraction Layer (HAL)
"Learning AOSP" - Android Hardware Abstraction Layer (HAL)"Learning AOSP" - Android Hardware Abstraction Layer (HAL)
"Learning AOSP" - Android Hardware Abstraction Layer (HAL)
Nanik Tolaram
 
Hardware Acceleration in WebKit
Hardware Acceleration in WebKitHardware Acceleration in WebKit
Hardware Acceleration in WebKit
Joone Hur
 
Mobile Browser Internal (Blink Rendering Engine)
Mobile Browser Internal (Blink Rendering Engine)Mobile Browser Internal (Blink Rendering Engine)
Mobile Browser Internal (Blink Rendering Engine)
Hyungwook Lee
 
Android's Multimedia Framework
Android's Multimedia FrameworkAndroid's Multimedia Framework
Android's Multimedia Framework
Opersys inc.
 
Embedded Android : System Development - Part IV (Android System Services)
Embedded Android : System Development - Part IV (Android System Services)Embedded Android : System Development - Part IV (Android System Services)
Embedded Android : System Development - Part IV (Android System Services)
Emertxe Information Technologies Pvt Ltd
 
Binder: Android IPC
Binder: Android IPCBinder: Android IPC
Binder: Android IPC
Shaul Rosenzwieg
 
5 Major Challenges in Interactive Rendering
5 Major Challenges in Interactive Rendering5 Major Challenges in Interactive Rendering
5 Major Challenges in Interactive Rendering
Electronic Arts / DICE
 
Render thead of hwui
Render thead of hwuiRender thead of hwui
Render thead of hwui
Rouyun Pan
 
Introduction to Flutter - truly crossplatform, amazingly fast
Introduction to Flutter - truly crossplatform, amazingly fastIntroduction to Flutter - truly crossplatform, amazingly fast
Introduction to Flutter - truly crossplatform, amazingly fast
Bartosz Kosarzycki
 

What's hot (20)

BKK16-315 Graphics Stack Update
BKK16-315 Graphics Stack UpdateBKK16-315 Graphics Stack Update
BKK16-315 Graphics Stack Update
 
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
 
LCE13: Android Graphics Upstreaming
LCE13: Android Graphics UpstreamingLCE13: Android Graphics Upstreaming
LCE13: Android Graphics Upstreaming
 
CS 354 Vector Graphics & Path Rendering
CS 354 Vector Graphics & Path RenderingCS 354 Vector Graphics & Path Rendering
CS 354 Vector Graphics & Path Rendering
 
Flutter talkshow
Flutter talkshowFlutter talkshow
Flutter talkshow
 
OpenGLES - Graphics Programming in Android
OpenGLES - Graphics Programming in Android OpenGLES - Graphics Programming in Android
OpenGLES - Graphics Programming in Android
 
Android Security Internals
Android Security InternalsAndroid Security Internals
Android Security Internals
 
Embedded Android Workshop
Embedded Android WorkshopEmbedded Android Workshop
Embedded Android Workshop
 
Android Chromium Rendering Pipeline
Android Chromium Rendering PipelineAndroid Chromium Rendering Pipeline
Android Chromium Rendering Pipeline
 
Overview of Android binder IPC implementation
Overview of Android binder IPC implementationOverview of Android binder IPC implementation
Overview of Android binder IPC implementation
 
"Learning AOSP" - Android Hardware Abstraction Layer (HAL)
"Learning AOSP" - Android Hardware Abstraction Layer (HAL)"Learning AOSP" - Android Hardware Abstraction Layer (HAL)
"Learning AOSP" - Android Hardware Abstraction Layer (HAL)
 
Hardware Acceleration in WebKit
Hardware Acceleration in WebKitHardware Acceleration in WebKit
Hardware Acceleration in WebKit
 
Mobile Browser Internal (Blink Rendering Engine)
Mobile Browser Internal (Blink Rendering Engine)Mobile Browser Internal (Blink Rendering Engine)
Mobile Browser Internal (Blink Rendering Engine)
 
Android's Multimedia Framework
Android's Multimedia FrameworkAndroid's Multimedia Framework
Android's Multimedia Framework
 
Embedded Android : System Development - Part IV (Android System Services)
Embedded Android : System Development - Part IV (Android System Services)Embedded Android : System Development - Part IV (Android System Services)
Embedded Android : System Development - Part IV (Android System Services)
 
Binder: Android IPC
Binder: Android IPCBinder: Android IPC
Binder: Android IPC
 
5 Major Challenges in Interactive Rendering
5 Major Challenges in Interactive Rendering5 Major Challenges in Interactive Rendering
5 Major Challenges in Interactive Rendering
 
Render thead of hwui
Render thead of hwuiRender thead of hwui
Render thead of hwui
 
Introduction to Flutter - truly crossplatform, amazingly fast
Introduction to Flutter - truly crossplatform, amazingly fastIntroduction to Flutter - truly crossplatform, amazingly fast
Introduction to Flutter - truly crossplatform, amazingly fast
 

Similar to Hardware Accelerated 2D Rendering for Android

SIGGRAPH Asia 2012: GPU-accelerated Path Rendering
SIGGRAPH Asia 2012: GPU-accelerated Path RenderingSIGGRAPH Asia 2012: GPU-accelerated Path Rendering
SIGGRAPH Asia 2012: GPU-accelerated Path Rendering
Mark Kilgard
 
SIGGRAPH 2012: GPU-Accelerated 2D and Web Rendering
SIGGRAPH 2012: GPU-Accelerated 2D and Web RenderingSIGGRAPH 2012: GPU-Accelerated 2D and Web Rendering
SIGGRAPH 2012: GPU-Accelerated 2D and Web Rendering
Mark Kilgard
 
GTC 2012: GPU-Accelerated Path Rendering
GTC 2012: GPU-Accelerated Path RenderingGTC 2012: GPU-Accelerated Path Rendering
GTC 2012: GPU-Accelerated Path Rendering
Mark Kilgard
 
Remote Graphical Rendering
Remote Graphical RenderingRemote Graphical Rendering
Remote Graphical Rendering
Joel Isaacson
 
The Power of WebGL - Hackeando sua GPU com JavaScript
The Power of WebGL - Hackeando sua GPU com JavaScriptThe Power of WebGL - Hackeando sua GPU com JavaScript
The Power of WebGL - Hackeando sua GPU com JavaScript
Raphael Amorim
 
Understanding Hardware Acceleration on Mobile Browsers
Understanding Hardware Acceleration on Mobile BrowsersUnderstanding Hardware Acceleration on Mobile Browsers
Understanding Hardware Acceleration on Mobile Browsers
Ariya Hidayat
 
Understanding hardware acceleration on mobile browsers presentation
Understanding hardware acceleration on mobile browsers presentationUnderstanding hardware acceleration on mobile browsers presentation
Understanding hardware acceleration on mobile browsers presentation
Justin Dorfman
 
Computer Graphics Notes
Computer Graphics NotesComputer Graphics Notes
Computer Graphics Notes
Gurpreet singh
 
Advanced Web Graphics with Canvas
Advanced Web Graphics with CanvasAdvanced Web Graphics with Canvas
Advanced Web Graphics with Canvas
Jason Harwig
 
Advanced #4 GPU & Animations
Advanced #4   GPU & AnimationsAdvanced #4   GPU & Animations
Advanced #4 GPU & Animations
Vitali Pekelis
 
(2) gui drawing
(2) gui drawing(2) gui drawing
(2) gui drawing
Nico Ludwig
 
Introduction to Computer graphics
Introduction to Computer graphicsIntroduction to Computer graphics
Introduction to Computer graphics
LOKESH KUMAR
 
(2) gui drawing
(2) gui drawing(2) gui drawing
(2) gui drawing
Nico Ludwig
 
GDSC KIIT Huddle Session 4 - "Graphics Pipelining"
GDSC KIIT Huddle Session 4 - "Graphics Pipelining"GDSC KIIT Huddle Session 4 - "Graphics Pipelining"
GDSC KIIT Huddle Session 4 - "Graphics Pipelining"
Harshil Gupta
 
아이폰강의(7) pdf
아이폰강의(7) pdf아이폰강의(7) pdf
아이폰강의(7) pdfsunwooindia
 
[2018 GDC] Real-Time Ray-Tracing Techniques for Integration into Existing Ren...
[2018 GDC] Real-Time Ray-Tracing Techniques for Integration into Existing Ren...[2018 GDC] Real-Time Ray-Tracing Techniques for Integration into Existing Ren...
[2018 GDC] Real-Time Ray-Tracing Techniques for Integration into Existing Ren...
Takahiro Harada
 
2008 brokerage 04 smart vision system [compatibility mode]
2008 brokerage 04 smart vision system [compatibility mode]2008 brokerage 04 smart vision system [compatibility mode]
2008 brokerage 04 smart vision system [compatibility mode]imec.archive
 
2008 brokerage 04 smart vision system [compatibility mode]
2008 brokerage 04 smart vision system [compatibility mode]2008 brokerage 04 smart vision system [compatibility mode]
2008 brokerage 04 smart vision system [compatibility mode]imec.archive
 

Similar to Hardware Accelerated 2D Rendering for Android (20)

SIGGRAPH Asia 2012: GPU-accelerated Path Rendering
SIGGRAPH Asia 2012: GPU-accelerated Path RenderingSIGGRAPH Asia 2012: GPU-accelerated Path Rendering
SIGGRAPH Asia 2012: GPU-accelerated Path Rendering
 
SIGGRAPH 2012: GPU-Accelerated 2D and Web Rendering
SIGGRAPH 2012: GPU-Accelerated 2D and Web RenderingSIGGRAPH 2012: GPU-Accelerated 2D and Web Rendering
SIGGRAPH 2012: GPU-Accelerated 2D and Web Rendering
 
GTC 2012: GPU-Accelerated Path Rendering
GTC 2012: GPU-Accelerated Path RenderingGTC 2012: GPU-Accelerated Path Rendering
GTC 2012: GPU-Accelerated Path Rendering
 
Remote Graphical Rendering
Remote Graphical RenderingRemote Graphical Rendering
Remote Graphical Rendering
 
The Power of WebGL - Hackeando sua GPU com JavaScript
The Power of WebGL - Hackeando sua GPU com JavaScriptThe Power of WebGL - Hackeando sua GPU com JavaScript
The Power of WebGL - Hackeando sua GPU com JavaScript
 
Understanding Hardware Acceleration on Mobile Browsers
Understanding Hardware Acceleration on Mobile BrowsersUnderstanding Hardware Acceleration on Mobile Browsers
Understanding Hardware Acceleration on Mobile Browsers
 
Understanding hardware acceleration on mobile browsers presentation
Understanding hardware acceleration on mobile browsers presentationUnderstanding hardware acceleration on mobile browsers presentation
Understanding hardware acceleration on mobile browsers presentation
 
Pc54
Pc54Pc54
Pc54
 
Computer Graphics Notes
Computer Graphics NotesComputer Graphics Notes
Computer Graphics Notes
 
Advanced Web Graphics with Canvas
Advanced Web Graphics with CanvasAdvanced Web Graphics with Canvas
Advanced Web Graphics with Canvas
 
Advanced #4 GPU & Animations
Advanced #4   GPU & AnimationsAdvanced #4   GPU & Animations
Advanced #4 GPU & Animations
 
(2) gui drawing
(2) gui drawing(2) gui drawing
(2) gui drawing
 
Introduction to Computer graphics
Introduction to Computer graphicsIntroduction to Computer graphics
Introduction to Computer graphics
 
(2) gui drawing
(2) gui drawing(2) gui drawing
(2) gui drawing
 
GDSC KIIT Huddle Session 4 - "Graphics Pipelining"
GDSC KIIT Huddle Session 4 - "Graphics Pipelining"GDSC KIIT Huddle Session 4 - "Graphics Pipelining"
GDSC KIIT Huddle Session 4 - "Graphics Pipelining"
 
아이폰강의(7) pdf
아이폰강의(7) pdf아이폰강의(7) pdf
아이폰강의(7) pdf
 
Task 2
Task 2Task 2
Task 2
 
[2018 GDC] Real-Time Ray-Tracing Techniques for Integration into Existing Ren...
[2018 GDC] Real-Time Ray-Tracing Techniques for Integration into Existing Ren...[2018 GDC] Real-Time Ray-Tracing Techniques for Integration into Existing Ren...
[2018 GDC] Real-Time Ray-Tracing Techniques for Integration into Existing Ren...
 
2008 brokerage 04 smart vision system [compatibility mode]
2008 brokerage 04 smart vision system [compatibility mode]2008 brokerage 04 smart vision system [compatibility mode]
2008 brokerage 04 smart vision system [compatibility mode]
 
2008 brokerage 04 smart vision system [compatibility mode]
2008 brokerage 04 smart vision system [compatibility mode]2008 brokerage 04 smart vision system [compatibility mode]
2008 brokerage 04 smart vision system [compatibility mode]
 

More from National Cheng Kung University

PyPy's approach to construct domain-specific language runtime
PyPy's approach to construct domain-specific language runtimePyPy's approach to construct domain-specific language runtime
PyPy's approach to construct domain-specific language runtime
National Cheng Kung University
 
Making Linux do Hard Real-time
Making Linux do Hard Real-timeMaking Linux do Hard Real-time
Making Linux do Hard Real-time
National Cheng Kung University
 
2016 年春季嵌入式作業系統課程說明
2016 年春季嵌入式作業系統課程說明2016 年春季嵌入式作業系統課程說明
2016 年春季嵌入式作業系統課程說明
National Cheng Kung University
 
Interpreter, Compiler, JIT from scratch
Interpreter, Compiler, JIT from scratchInterpreter, Compiler, JIT from scratch
Interpreter, Compiler, JIT from scratch
National Cheng Kung University
 
進階嵌入式作業系統設計與實做 (2015 年秋季 ) 課程說明
進階嵌入式作業系統設計與實做 (2015 年秋季 ) 課程說明進階嵌入式作業系統設計與實做 (2015 年秋季 ) 課程說明
進階嵌入式作業系統設計與實做 (2015 年秋季 ) 課程說明
National Cheng Kung University
 
Construct an Efficient and Secure Microkernel for IoT
Construct an Efficient and Secure Microkernel for IoTConstruct an Efficient and Secure Microkernel for IoT
Construct an Efficient and Secure Microkernel for IoT
National Cheng Kung University
 
How A Compiler Works: GNU Toolchain
How A Compiler Works: GNU ToolchainHow A Compiler Works: GNU Toolchain
How A Compiler Works: GNU Toolchain
National Cheng Kung University
 
Virtual Machine Constructions for Dummies
Virtual Machine Constructions for DummiesVirtual Machine Constructions for Dummies
Virtual Machine Constructions for Dummies
National Cheng Kung University
 
給自己更好未來的 3 個練習:嵌入式作業系統設計、實做,與移植 (2015 年春季 ) 課程說明
給自己更好未來的 3 個練習:嵌入式作業系統設計、實做,與移植 (2015 年春季 ) 課程說明給自己更好未來的 3 個練習:嵌入式作業系統設計、實做,與移植 (2015 年春季 ) 課程說明
給自己更好未來的 3 個練習:嵌入式作業系統設計、實做,與移植 (2015 年春季 ) 課程說明
National Cheng Kung University
 
從線上售票看作業系統設計議題
從線上售票看作業系統設計議題從線上售票看作業系統設計議題
從線上售票看作業系統設計議題
National Cheng Kung University
 
進階嵌入式系統開發與實做 (2014 年秋季 ) 課程說明
進階嵌入式系統開發與實做 (2014 年秋季 ) 課程說明進階嵌入式系統開發與實做 (2014 年秋季 ) 課程說明
進階嵌入式系統開發與實做 (2014 年秋季 ) 課程說明
National Cheng Kung University
 
Xvisor: embedded and lightweight hypervisor
Xvisor: embedded and lightweight hypervisorXvisor: embedded and lightweight hypervisor
Xvisor: embedded and lightweight hypervisor
National Cheng Kung University
 
Making Linux do Hard Real-time
Making Linux do Hard Real-timeMaking Linux do Hard Real-time
Making Linux do Hard Real-time
National Cheng Kung University
 
Implement Runtime Environments for HSA using LLVM
Implement Runtime Environments for HSA using LLVMImplement Runtime Environments for HSA using LLVM
Implement Runtime Environments for HSA using LLVM
National Cheng Kung University
 
Priority Inversion on Mars
Priority Inversion on MarsPriority Inversion on Mars
Priority Inversion on Mars
National Cheng Kung University
 
Develop Your Own Operating Systems using Cheap ARM Boards
Develop Your Own Operating Systems using Cheap ARM BoardsDevelop Your Own Operating Systems using Cheap ARM Boards
Develop Your Own Operating Systems using Cheap ARM Boards
National Cheng Kung University
 
Lecture notice about Embedded Operating System Design and Implementation
Lecture notice about Embedded Operating System Design and ImplementationLecture notice about Embedded Operating System Design and Implementation
Lecture notice about Embedded Operating System Design and Implementation
National Cheng Kung University
 
Explore Android Internals
Explore Android InternalsExplore Android Internals
Explore Android Internals
National Cheng Kung University
 
中輟生談教育: 完全用開放原始碼軟體進行 嵌入式系統教學
中輟生談教育: 完全用開放原始碼軟體進行 嵌入式系統教學中輟生談教育: 完全用開放原始碼軟體進行 嵌入式系統教學
中輟生談教育: 完全用開放原始碼軟體進行 嵌入式系統教學
National Cheng Kung University
 

More from National Cheng Kung University (20)

PyPy's approach to construct domain-specific language runtime
PyPy's approach to construct domain-specific language runtimePyPy's approach to construct domain-specific language runtime
PyPy's approach to construct domain-specific language runtime
 
Making Linux do Hard Real-time
Making Linux do Hard Real-timeMaking Linux do Hard Real-time
Making Linux do Hard Real-time
 
2016 年春季嵌入式作業系統課程說明
2016 年春季嵌入式作業系統課程說明2016 年春季嵌入式作業系統課程說明
2016 年春季嵌入式作業系統課程說明
 
Interpreter, Compiler, JIT from scratch
Interpreter, Compiler, JIT from scratchInterpreter, Compiler, JIT from scratch
Interpreter, Compiler, JIT from scratch
 
進階嵌入式作業系統設計與實做 (2015 年秋季 ) 課程說明
進階嵌入式作業系統設計與實做 (2015 年秋季 ) 課程說明進階嵌入式作業系統設計與實做 (2015 年秋季 ) 課程說明
進階嵌入式作業系統設計與實做 (2015 年秋季 ) 課程說明
 
Construct an Efficient and Secure Microkernel for IoT
Construct an Efficient and Secure Microkernel for IoTConstruct an Efficient and Secure Microkernel for IoT
Construct an Efficient and Secure Microkernel for IoT
 
The Internals of "Hello World" Program
The Internals of "Hello World" ProgramThe Internals of "Hello World" Program
The Internals of "Hello World" Program
 
How A Compiler Works: GNU Toolchain
How A Compiler Works: GNU ToolchainHow A Compiler Works: GNU Toolchain
How A Compiler Works: GNU Toolchain
 
Virtual Machine Constructions for Dummies
Virtual Machine Constructions for DummiesVirtual Machine Constructions for Dummies
Virtual Machine Constructions for Dummies
 
給自己更好未來的 3 個練習:嵌入式作業系統設計、實做,與移植 (2015 年春季 ) 課程說明
給自己更好未來的 3 個練習:嵌入式作業系統設計、實做,與移植 (2015 年春季 ) 課程說明給自己更好未來的 3 個練習:嵌入式作業系統設計、實做,與移植 (2015 年春季 ) 課程說明
給自己更好未來的 3 個練習:嵌入式作業系統設計、實做,與移植 (2015 年春季 ) 課程說明
 
從線上售票看作業系統設計議題
從線上售票看作業系統設計議題從線上售票看作業系統設計議題
從線上售票看作業系統設計議題
 
進階嵌入式系統開發與實做 (2014 年秋季 ) 課程說明
進階嵌入式系統開發與實做 (2014 年秋季 ) 課程說明進階嵌入式系統開發與實做 (2014 年秋季 ) 課程說明
進階嵌入式系統開發與實做 (2014 年秋季 ) 課程說明
 
Xvisor: embedded and lightweight hypervisor
Xvisor: embedded and lightweight hypervisorXvisor: embedded and lightweight hypervisor
Xvisor: embedded and lightweight hypervisor
 
Making Linux do Hard Real-time
Making Linux do Hard Real-timeMaking Linux do Hard Real-time
Making Linux do Hard Real-time
 
Implement Runtime Environments for HSA using LLVM
Implement Runtime Environments for HSA using LLVMImplement Runtime Environments for HSA using LLVM
Implement Runtime Environments for HSA using LLVM
 
Priority Inversion on Mars
Priority Inversion on MarsPriority Inversion on Mars
Priority Inversion on Mars
 
Develop Your Own Operating Systems using Cheap ARM Boards
Develop Your Own Operating Systems using Cheap ARM BoardsDevelop Your Own Operating Systems using Cheap ARM Boards
Develop Your Own Operating Systems using Cheap ARM Boards
 
Lecture notice about Embedded Operating System Design and Implementation
Lecture notice about Embedded Operating System Design and ImplementationLecture notice about Embedded Operating System Design and Implementation
Lecture notice about Embedded Operating System Design and Implementation
 
Explore Android Internals
Explore Android InternalsExplore Android Internals
Explore Android Internals
 
中輟生談教育: 完全用開放原始碼軟體進行 嵌入式系統教學
中輟生談教育: 完全用開放原始碼軟體進行 嵌入式系統教學中輟生談教育: 完全用開放原始碼軟體進行 嵌入式系統教學
中輟生談教育: 完全用開放原始碼軟體進行 嵌入式系統教學
 

Recently uploaded

State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 

Recently uploaded (20)

State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 

Hardware Accelerated 2D Rendering for Android

  • 1. Hardware Accelerated 2D Rendering for Android Jim Huang ( 黃敬群 ) <jserv@0xlab.org> Developer, 0xlab Feb 19, 2013 / Android Builders Summit
  • 2. Rights to copy © Copyright 2013 0xlab http://0xlab.org/ contact@0xlab.org Attribution – ShareAlike 3.0 Corrections, suggestions, contributions and translations You are free are welcome! to copy, distribute, display, and perform the work to make derivative works Latest update: Feb 19, 2013 to make commercial use of the work 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. For any reuse or distribution, you must make clear to others the license terms of this work. Any of these conditions can be waived if you get permission from the copyright holder. Your fair use and other rights are in no way affected by the above. License text: http://creativecommons.org/licenses/by-sa/3.0/legalcode
  • 3. Agenda (1) Concepts (2) Performance Problems (3) Hardware Accelerating Case study: skia, webkit
  • 5. Revise what you saw on Android
  • 6. Exporting Graphics • can be exported from any of the levels of the graphics stack – Application, Graphic Toolkit, Graphic Rendering, Bitmapped Device
  • 7. Exporting Graphics - Application • Normal way Linux/Android/Iphone runs apps. – The application itself is exported and run locally.
  • 8. Exporting Graphics - Toolkit • Technically very complex. Android has 15 different toolkit API variants. • Every application can extend the toolkit with custom widgets (subclasses of android.view.View). Exporting Graphics - Rendering • Exports graphics at the rendering level. • In Android there are a number of rendering interfaces that can be used: – skia graphics – OpenGL ES 1.1 or OpenGL ES 2.0 – Android.view.View
  • 9. 2D Graphics • The display presents us the contents of something called the framebuffer. • The framebuffer is an area in (V)RAM • For each pixel on screen there‘s a corresponding memory cell in the framebuffer • Pixels are addressed with 2D coordinates.
  • 10. 2D Graphics • To change what is displayed → change the colors of pixels in (V)RAM. – Pixel colors are encoded as RGB or RGBA • To draw shapes → need to figure out which framebuffer pixels we have to set. – Images (bitmaps) are not special either – Pixels of the bitmap get stored in a memory area, just like we store framebuffer pixels. • To draw a bitmap to the framebuffer → copy the pixels. (Blitting) • We can perform the same operations on bitmaps as we perform on the framebuffer, e.g. draw shapes or other bitmaps.
  • 11. Blitting: copy (parts of) one bitmap to another Alpha Compositing: blitting + alpha blending • Alpha value of a pixel governs transparency • Instead of overwritting a destination pixel we mix its color with the source pixel. Source: Android Game Development 101, BadlogicGames Source: Android Game Development 101, BadlogicGames
  • 13. Rendering Level: skia • The rendering level is the graphics layer that actually “colors” the pixels in the bitmap. • skia is a compact open source graphics library written in C++. • Currently used in Google Chrome, Chrome OS, and Android. Skia is Greek for “shadow” Skia is Greek for “shadow”
  • 14. Rendering Level: skia • skia is a complete 2D graphic library for drawing Text, Geometries, and Images. Features include: – 3x3 matrices w/ perspective – Antialiasing, transparency, filters – Shaders, xfermodes, maskfilters, patheffects
  • 15. Rendering Level: skia • Each skia call has two components: – the primitive being drawing (SkRect, SkPath, etc.) – color/style attributes (SkPaint) • Usage example: canvas.save(); canvas.rotate(45); canvas.drawRect(rect, paint); canvas.drawText(“abc”, 3, x, y, paint); canvas.restore();
  • 16. WebKit in Android event WebCore Refresh the surface (expose event) Android.webkit.WebViewCore android.webkit.WebView Skia bridge ... WebKit skia skia JNI v8 JNI skia-gpu skia-gpu Surface Surface
  • 17. CPU vs. GPU Limited at Rendering Tasks over Time 100% 100% 90% 90% 80% 80% 70% 70% 60% 60% 50% GPU 50% GPU CPU CPU 40% 40% 30% 30% 20% 20% 10% 10% 0% 0% 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 Pipelined 3D Interactive Rendering Path Rendering Goal of NV_path_rendering is to make path rendering a GPU-limited task Render all interactive pixels, whether 3D or 2D or web content with the GPU Source: GPU-Accelerated 2D and Web Rendering, Mark Kilgard, NVIDIA Source: GPU-Accelerated 2D and Web Rendering, Mark Kilgard, NVIDIA
  • 18. Rendering Paths [ skia + gpu; Chrome browser ] JavaScript (Canvas) OpenGL ES CPU GPU Computing Draw Call Draw Call Context Computing Draw Call Draw Call Context Computing Draw Call Draw Call Context ck lene Computing Flush Bott Draw Call Draw Call Context Computing Draw Call Draw Call Context
  • 19. Rendering Paths [ ideal case ] JavaScript (Canvas) GL request OpenGL ES CPU GPU Optimizer Draw Call Draw Call Draw Call Draw Computing Draw Call Call Context Flush Draw Call
  • 20. skia + gpu • Problems – calls glDrawSomethings too many times – changes gl states too many times – switches FBO too many times – vector graphics APIs and shadows are really slow • Increases dramatically CPU overhead Draw Call At Once Ideal GL skia Bitmap Sprite Good Good Convex Path Good Poor Concave Path Good Poor Bitmap Sprite + Path Good Poor Path + Different Shadow Good Poor Text + Different Draw Call Good Poor
  • 21. The performance problem is still rendering... Let's look into deeper.
  • 22. Hardware Accelerating How Android utilizes GPU functionalities
  • 23. Myths and Facts • Myth: Android 1.x is slow because of no hardware accelerations – NOT TRUE! window compositing utilizes hardware accelerations. – But it is quite constrained • There are 4 Window: Status Bar, Wallpaper, Launcher, and Menu in the right screenshot. – Hardware composites animations of Activity transition, the fading in/out of Menu. • However, the content of Window (Canvas) is being accelerated by hardware since Android 3.x
  • 24. View & TextureView • View – represents the basic building block for UI – occupies a rectangular area on the screen and is responsible for drawing and event handling. • SurfaceView – provides a dedicated drawing surface embedded inside of a view hierarchy. • TextureView – Since Android 4.0 – Only activated when hardware acceleration is enabled ! – has the same property of SurfaceView, but you can create GL surface and perform GL rendering above them.
  • 25. from EGL to SurfaceFlinger hardware hardware android software android software OpenGL|ES OpenGL|ES OpenGL|ES renderer OpenGL|ES renderer
  • 26.
  • 27.
  • 28. Case study: skia Paint, Canvas, Backend
  • 29. skia, again Drawing basic primitives include rectangles, rounded rectangles, ovals, circles, arcs, paths, lines, text, bitmaps and sprites. Paths allow for the creation of more advanced shapes. Canvas encapsulates all of the state about drawing into a device (bitmap). While Canvas holds the state of the drawing device, the state (style) of the object being drawn is held by Paint, which is provided as a parameter to each of the draw() methods. Paint holds attributes such as color, typeface, textSize, strokeWidth, shader (e.g. gradients, patterns), etc.
  • 30. skia rendering pipeline Source: http://www.xenomachina.com/2011/05/androids-2d-canvas-rendering-pipeline.html Source: http://www.xenomachina.com/2011/05/androids-2d-canvas-rendering-pipeline.html
  • 31. Skia backends • Render in software – create a native window and then – wrap a pointer to its buffer as an SkBitmap – Initialize an SkCanvas with the bitmap • Render in hardware acceleration – create a GLES2 window or framebuffer and – create the appropriate GrContext, SkGpuDevice, and SkGpuCanvas
  • 32. How Views are Drawn [Android 2.x]
  • 33. Hardware-accelerated 2D Rendering • Since Android 3.x, more complex than before! • Major idea: transform the implementation of 2D Graphics APIs into OpenGL|ES requests • Texture, Shader, GLContext, pipeline, … • Major parts for hardware-accelerated 2D Rendering – Primitive Drawing: Shape, Text,Image – Layer/Surface Compositing
  • 34. Control hardware accelerations • Application level <application android:hardwareAccelerated="true"> – Default value • False in Android 3.x, True in Android 4.x • Activity • Window WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED • View – setLayerType(View.LAYER_TYPE_SOFTWARE,null) View.setLayerType(int type,Paint p) Layers = Off-screen Buffers or Caches Layers = Off-screen Buffers or Caches
  • 35. View Layers since Android 3.x Source:Accelerated Android Rendering, Google I/O 2011 Source:Accelerated Android Rendering, Google I/O 2011
  • 36. How Views are Drawn [Android 3.x] HardwareCanvas → SkPaint → GLRenderer no SkGpuCanvas/SkGpuDevice?! Why can't skia use its OpenGL backend directly?
  • 37. To answer the previous question, we have to learn Display List first • A display list (or display file) is a series of graphics commands that define an output image. The image is created (rendered) by executing the commands. • A display list can represent both two- and three-dimensional scenes. • Systems that make use of a display list to store the scene are called retained mode systems as opposed to immediate mode systems. http://en.wikipedia.org/wiki/Display_list http://developer.android.com/guide/topics/graphics/hardware-accel.html
  • 38. Display List [Android 3.x] • A display list records a series of graphics related operation and can replay them later. Display lists are usually built by recording operations on a android.graphics.Canvas. • Replaying the operations from a display list avoids executing views drawing code on every frame, and is thus much more efficient.
  • 39. Display List [Android 4.1] Source:For Butter or Worse, Google I/O 2012 Source:For Butter or Worse, Google I/O 2012
  • 40. Case study: webkit RenderObjects, RenderTree, RenderLayers, Accelerated Compositing, Rendering Flow, Tiled Texture
  • 41. WebKit Rendering • RenderObjects • RenderTree • RenderLayers
  • 42. WebKit Rendering – RenderObject • Each node in the DOM tree that produces visual output has a corresponding RenderObject. • RenderObjects are stored in a parallel tree structure, called the Render Tree. • RenderObject knows how to present (paint) the contents of the Node on a display surface. • It does so by issuing the necessary draw calls to the GraphicsContext associated with the page renderer. – GraphicsContext is ultimately responsible for writing the pixels on the bitmap that gets displayed to the screen.
  • 43. WebKit Rendering – RenderTree RenderObjects are stored in a parallel tree structure, called Render Tree.
  • 44. WebKit Rendering – RenderLayers • Each RenderObject is associated with a RenderLayer either directly or indirectly via an ancestor RenderObject. • RenderObjects that share the same coordinate space (e.g. are affected by the same CSS transform) typically belong to the same RenderLayer. • RenderLayers exist so that the elements of the page are composited in the correct order to properly display overlapping content, semitransparent elements, etc.
  • 45. RenderLayers • In general a RenderObject warrants the creation of a RenderLayer if – is the root object for the page – has explicit CSS position properties (relative, absolute or a ransform) – is transparent – has overflow, an alpha mask or reflection – Corresponds to <canvas> element that has a 3D (WebGL) context Corresponds to a <video> element
  • 46. WebKit Rendering • RenderLayer hierarchy is traversed recursively starting from the root and the bulk of the work is done in RenderLayer::paintLayer(). • WebView is the web page encapsulated in a UI component. • Web page update → the redraw of WebView – Adjust layers structure according to the latest content and then render/record the updated – Render the updated content • Various approaches of Rendering Architecture – Use texture or vector (backing store) as the internal representation – multithreaded, multiple processes.
  • 47. Accelerated Compositing • Idea: to optimize for cases where an element would be painted to the screen multiple times without its content changing. – For example, a menu sliding into the screen, or a static toolbar on top of a video. • It does so by creating a scene graph, a tree of objects (graphics layers), which have properties attached to them - transformation matrix, opacity, position, effects etc., and also a notification when the layer's content needs to be re-rendered.
  • 48.
  • 49. • When accelerated compositing is enabled, some (but not all) of the RenderLayer's get their own backing surface (compositing layer) into which they paint instead of drawing directly into the common bitmap for the page. • Compositor is responsible for applying the necessary transformations (as specified by the layer's CSS transform properties) to each layer before compositing it.
  • 50. • Since painting of the layers is decoupled from compositing, invalidating one of these layers only results in repainting the contents of that layer alone and recompositing.
  • 51. Rendering Flow • Layers Sync → done by WebCore itself • Layers Compositing → done by WebKit port (like Android) • Android 4.x supports Accelerated Compositing and Hardware Accelerations – decided by the property of given Canvas
  • 52. [ skia + gpu; Chrome browser ] JavaScript (Canvas) OpenGL ES CPU GPU Computing Draw Call Draw Call Context Computing Draw Call Draw Call Context Computing Draw Call Draw Call Context eck ttlen Computing Flush Draw Call Draw Call Bo Context Computing Draw Call Draw Call Context • When WebView is redrawn, UI thread performans compositing – First, TiledTexture in Root Layer of current Page ViewPort – Then, TiledTexture in other BackingLayers • The generation of TiledTexture can utilize both CPU and GPU. – Android 4.0 still uses CPU.
  • 53. Flow of Generating Tiled Texture • Using CPU – Take one global SkBitmap and reset (size equals to one Tile) – Draw SkPicture → global SkBitmap – Memory copy from SkBitmap to Graphics Buffer of Tile • Using GPU – All real rendering occurs in TextureGenerator thread – Draw the pre-gernated textures Page → vector backing store, layer → texture
  • 54. Techniques to make it better JavaScript (Canvas) GL request OpenGL ES CPU GPU Optimizer Draw Call Draw Call Draw Call Draw Computing Draw Call Call Context Flush Draw Call • improve object lifetime management • Use GPU specific Backing store implementation • prefetch optimization for DOM Tree Traversal • improve texture sharing mechanisms • Eliminate the loading of U thread
  • 55. SurfaceFlinger • Android‘s window compositor – Each window is also a layer. – The layers are sorted by Z-order. The Z-order is just the layer type as specified in PhoneWindowManager.java. • When adding a layer with a Z-order that is already used by some other layer in SurfaceFlinger‘s list of layers it is put on top of the layers with the same Z-order. • Even many SurfaceFlinger rendering operations are inherently flat (2D), it uses OpenGL ES 1.1 for rendering – May be memory limited on devices with small displays – Copybit acceleration may be desirable for UI on some devices → deprecated since Android 2.3 – It is known to improve UX with custom copybit module
  • 56. (low-level) overhead • Composition overhead – Android extensions such as “EGLImage from Android native buffer”, can employ copybit (2D) backend to further offload GPU → use non-linear textures for 3D applications to improve memory access locality • Native ↔ Java communication overhead – Native code for key operations – Can be observed by TraceView tool • Cache management overhead – range-based L1 and L2 cache functions (clean, invalidate, flush) – Normally uncached graphics memory is sufficient for gaming use cases – Cached buffers result in higher performance for CPU rendering in compositing systems
  • 57. Performance Tips • Display List is crucial to user experience, but it has to be scheduled properly, otherwise CPU loading gets high unexpectedly. • Always verify and probe graphics system using Strict Mode • When hardware acceleration is enable, prevent the following operations from being modified/created frequently: – Bitmap, Shape, Paint, Path
  • 58. Reference • Skia & FreeType: Android 2D Graphics Essentials, Kyungmin Lee, LG Electronics • How about some Android graphics true facts? Dianne Hackborn (2011) • Android 4.0 Graphics and Animations, Romain Guy & Chet Haase (2011) • Learning about Android Graphics Subsystem, Bhanu Chetlapalli (2012) • Service 與 Android 系統設計,宋寶華