SlideShare a Scribd company logo
1 of 41
Download to read offline
Android Chromium Rendering Pipeline
이형욱 (hyungwook.lee@navercorp.com)
시스템스컴퓨팅G / NAVER LABS
2015-04
2
0. Contents
Chapter 1: 브라우저 렌더링에서의 Critical Path란 무엇인가?
① Summary of browser’s main flows
② HTML Parser
③ JavaScriptEngine
④ Render Tree, Layout
⑤ Rendering Pipeline Runs on Main Thread
⑥ New Rendering Model
⑦ GPU Accelerated Compositing
Chapter 2: Chromium은 렌더링 성능 향상을 위하여…
① Chrome Vs Chromium
② Why Multi Process Architecture?
③ GPU Process
④ Multi Threads Models in Renderer Process
⑤ Chromium Scheduler: Right things right time
Chapter 3: Chromium-powered Android WebView
① What is Android WebView?
② Android WebView Version History
③ Chromium Powered WebView Structure
④ Chrome Vs Android Rendering model
⑤ Chrome Vs Chromium WebView
⑥ Chromium WebView Rendering Pipeline
⑦ The Future of WebView?
3
Chapter 1, 브라우저 렌더링에
서의 Critical Path란 무엇인가?
4
<html>
<head>
<title> NAVER </title>
</head>
<body>
<div>
<h1> Hello </h1>
<p> World </p>
</div>
</body>
</html>
1. Summary of browser main flows.
[Source: How browsers work]
5
HEAD
TITLE
NAVER
BODY
DIV
H1 P
HTML
Hello World
<html>
<head>
<title> NAVER </title>
</head>
<body>
<div>
<h1> Hello </h1>
<p> World </p>
</div>
</body>
</html>
2. HTML Parser
6
3. Java Script Engine
Source Code Parser Syntax Tree
Bytecode
Generator
Bytecode
JIT Compiler Machine Code
Execution
Loader
Parser
DOM
Java Script
HTML DOM API
Evaluate
7
HTML
CSS
DOM
Tree
Style
Rules
Renderer
TreeLookup
4. Render Tree Creation
8
HEAD
TITLE
NAVER
BODY
DIV
H1 P
HTML
Hello World
Block
Block
Block
Block Block
Inline Inline
5. Render Tree
9
6. Layout
HEAD
TITLE
NAVER
BODY
DIV
H1 P
HTML
Hello World
Block
Block
Block
Block Block
Inline Inline
(0, 0, 1024, 768)
(0, 0, 1024, 768)
(0, 0, 1024, 55)
(10, 20, 1024, 37) (10, 80, 1024, 18)
10
7. Rendering
Block (html)
Block (body)
Block (div)
Block (h1) Block (p)
Inline (hello) Inline (world)
(0, 0, 1024, 768)
(0, 0, 1024, 768)
(0, 0, 1024, 55)
(10, 20, 1024, 37) (10, 80, 1024, 18) 1024
768<div>
11
8. Rendering Pipeline Runs on Main Thread
[Source: Blink Rendering Pipeline]
[Source: Chrome Graphics - BlinkOn 1]
12
9. New Rendering Model: Layers (1/4)
[Source: WebKit.org]
13
9. New Rendering Model: Layers (2/4)
1. Avoid unnecessary repainting
- If yellow and red have their own layers, then nothing needs
"repainting" while this example animates.
2. Makes some features more efficient or practical
- Including: Scrolling, 3D CSS(translate3d, …), opacity, filters, WebGL, etc.
[Source: Compositing in Blink and WebKit]
14
9. New Rendering Model: Layers (3/4)
1. It's the root object for the page. <html>
2. CSS position properties (relative, absolute)
3. Has overflow, an alpha mask or reflection
4. CSS filter
5. CSS 3D Transform , Animations
6. <canvas>, <video>
7. will-change (Chrome 36, Firefox 36, Opera 24)
15
Cost of Multi Layers: Memory, Computing
<Layer를 너무 많이 사용할 경우 Compositing 시간이 오래 걸림>
9. New Rendering Model: Layers (4/4)
16
10. GPU Accelerated Compositing
1. 각 Layer 별 bitmap을 생성 (Render Layer traversing)
2. Text와 Image는 CPU에서 Rasterization
3. Textures upload into Video memory
4. Compositor에서 Layer 순서에 맞게 Texture를 drawing하여 화면에 Update
17
Chapter 2, Chromium은 렌더
링 성능 향상을 위하여 어떤 기
술들을 사용하고 있는가?
18
Google Chrome Chromium
Logo Colorful Blue
Crash reporting Yes, if you turn it on None
User metrics Yes, if you turn it on No
Video and audio tags AAC, MP3, Vorbis and Theora Vorbis and Theora by default
Adobe Flash
custom (non-free) plugin
included in release
supports NPAPI plugins,
including the one from Adobe
PDF support
custom (non-free) plugin
included in release
downloads and displays with
system PDF viewer
Code Tested by Chrome developers
May be modified by
distributions
Sandbox Always on Depending on the distribution
Quality Assurance
New releases are tested before
sending to users
Depending on the distribution
1. Chrome Vs Chromium
19
2. Why Multi Process Architecture?
기존 브라우저의 문제점
• 현재(크롬 제작 당시)의 브라우저는 과거의 OS와 비슷한 구조
• 과거의 OS는 단일 사용자, 협조적 멀티 태스킹 시스템
• 이와 같은 시스템에서, 어떤 어플리케이션의 문제는 OS 전체의 안정성에 영향을 미침
• 단일 프로세스 모델의 브라우저에서는 한 페이지의 문제가 브라우저 전체에 문제를 일으킴
문제해결을 위한 접근
• 절대적으로 안정적인 렌더링 엔진을 만드는 것은 거의 불가능함
• 최근의 OS는 각 어플리케이션을 고립시킴으로써 특정 어플리케이션의 문제가 시스템 전체의 안정
성에 영향을 미치지 않도록 하며, 사용자 각자의 데이터를 보호하고 있음
20
3. Chromium Rendering Pipeline
[Source: Chrome Graphics - BlinkOn 1]
21
• GPU Process의 구조적 특징: Security, Robustness, Uniformity, Parallelism
• Client(Render Process): GL Command를 생성, Ring Buffer에 Insert
-> 일반적인 페이지의 경우 Texture Upload용으로 사용, HTML5 Canvas / WebGL은 직접 GL Command를 사용
• Server(GPU Process): Command를 fetch, execution.
• GL command는 GL ES 2.0 API와 거의 유사한 Async command
4. GPU Process
[Source: GPU Accelerated Compositing in Chrome]
22
5. Multi Threads: Main Thread Rendering
[Source: Chrome Graphics - BlinkOn 1]
23
5. Multi Threads: Threaded Compositor
[Source: Chrome Graphics - BlinkOn 1]
24
5. Multi Threads: Threaded Rasterization
[Source: Chrome Graphics - BlinkOn 1]
25
6. Skia’s SkPicture Canvas
A modern 2D graphics library
SkPicture, SkPicturePlayBack:
Records and replay draw operations.
[http://www.dorothybrowser.com/parallelizing-canvas-rendering/]
26
7. Chromium Rendering Pipeline in detail
1. Record 2. Raster 2.5 Upload 3. Composite
update
record
Thread
Proxy
update
recordPicture
Layer
updatePicture
LayerImpl
Raster
LayerTreeHost
update
recordupdate
recordGraphics
Layer
Blink LayerTreeHostImpl
Proxy
Main Thread Compositor Thread Raster Threads
Call into WebKit
which calls Skia
SkPicture records
the paint for
deferred raster
Decode images
In parallel
Raster into
shared memory
Send to GPU
process using
custom extension
GPU process does
glTexImage2d
asynchronously
Send draw cmds
To GPU Process
over command
buffer
glBindTexture
glDrawElements
Main Thread Raster Thread Compositor Thread
Tree Sync
27
8. Chromium Scheduler: Right things right time
1. Record
3. Raster
4. Upload
5. Composite
2. Tree Sync
6. SwapBuffer
Scheduler
Begin
Frame
Commit
Pending
Tree
Draw
& Swap
Buffer
Update
Visible
Tiles
<StateMachine in Compositor Threads>
Activate
Pending
Tree
VSync
28
Renderer Process
Cache Thread File Thread DB Thread IO Thread
I/O
Thread
Browser Process
Main Thread
Renderer Process
IPC
RenderView
RenderWidget
Blink
RenderView
RenderWidget RenderWidget
Blink Blink
RenderView
WebContents
RenderViewHost
Manager
RenderViewHost
RenderWidgetHost
RenderViewHost
RenderWidgetHost
RenderViewHost
RenderWidgetHost
SiteInstance RenderProcessHost
SiteInstance RenderProcessHost
Main ThreadMain Thread
WebContents
RenderViewHost
Manager
RenderMainThread
(Single Process Mode)
1
2
3
4
5
6 Compositor
GPU Thread
(Android)
Process Launcher
Thread
Raster
I/O
Thread
Compositor
Raster
9. Chromium Architecture in detail
29
Chapter 3, Android Chrome과
Chromium-powered WebView
의 구조적 차이는 무엇인가?
30
1. What is Android WebView?
Web content in a box:
- Powers browsers such as AOSP Browser
- Displays almost all mobile banner ads
- Can be used to create portable HTML-based apps
- Often intermixed imperceptibly with native Views
<- Android View
<- Android WebView
31
2. Android WebView Version History
Android <= J: custom WebKit-based “classic” WebView
Android K: Chromium 30 / 33-based WebView
Android L: Unbundled Evergreen WebView
http://com.odroid.com/sigong/nf_file_board/nfile_board_view.php?keyword=&tag=
ODROID-U3&bid=214
http://www.ibtimes.co.uk/moto-g-finally-tastes-android-5-0-lollipop-via-cyanogenmod-12-unofficial-
build-1475895
32
3. Chromium Powered WebView Structure
Blink(WebKit)
Content
(Multi-process-impl)
Content API
Blink
Chromium
Android
WebView
Framework
Chrome
Browser
Framework
33
4. Chrome Vs Android Rendering Model
Make main
thread free
Make sure
contents
on time
34
5. Chrome Vs Chromium WebView
Chrome
Multi-process
 UI thread
 GPU thread
 Texture upload thread
 Per renderer process:
o Blink thread
o CC impl thread
o Raster thread
Chromium Scheduler
SurfaceView
Chromium WebView
Single-process
 Combined UI + renderer CC thread
 Android RenderThread (+in-proces
s GPU thread)
 Canvas/WebGL GPU thread
 Blink thread
 Raster thread
Android Rendering Scheduer
Draw functor (Private API)
[Source: Android WebView rendering BlinkOn 3]
35
6. Accelerated Android Rendering
[Source: http://www.slideshare.net/deview/1d6review-of-android-l-developer-preview]
[MainThread]
36
7. Chromium WebView Rendering Pipeline in K
DrawGLFunction()
Synchronous Compositor
ViewRootImpl
performDraw()
View
Draw(Canvas)
View
onDraw(Canvas)
HardwareCanvas
draw*(…,Paint)
WebView::onDraw()
Set draw functor via DrawGLFunctor::requestDrawGL()
(canvas.callDrawGLFunction(mNativeDrawGLFunctor))
3. Composite
Chromium WebView
1. Record 2. Raster
Main
Blink Thread Raster Threads Main Thread
37
8. Chromium WebView Rendering Pipeline in L
WebView::onDraw()
1. Set draw functor
2. Request Record & Raster
Synchronous Compositor
View
onDraw(Canvas)
HardwareCanvas
draw*(…,Paint)
Chromium WebView
1. Record 2. Raster
Main
Raster Threads
ViewRootImpl
performDraw()
Render
Blink Thread
DrawGLFunction()
Synchronous Compositor
3. Composite
Render Thread
38
9. Android Chromium WebView Architecture
Blink Thread Cache Thread File Thread DB Thread IO Thread
Main Thread
IPC
WebContents
RenderViewHost
Manager
RenderViewHost
RenderWidgetHost
RenderViewHost
RenderWidgetHost
RenderViewHost
RenderWidgetHost
SiteInstance RenderProcessHost
SiteInstance RenderProcessHost
Chromium WebView’s Process
RenderView
RenderWidget
Blink
Process Launcher
Thread
Raster Thread
WebView
39
10. The Future of WebView?
“Under active debate at the moment” (2014/11)
1. Opposing use cases
1) WebView as a browser-in-a-box, Vs
2) WebView as one tool in a hybrid app toolset
2. Opposing update priorities
1) App developers want the latest features and
performance improvements
2) They also want stability to the point of bug-for-bug
compatibility
[Source: Android WebView rendering BlinkOn 3]
40
Appendix #1: References
1. http://www.w3.org/TR/CSS2/
2. http://www.w3.org/TR/DOM-Level-2-Core/core.html
3. http://www.html5rocks.com/en/tutorials/internals/howbrowserswork/
4. http://deview.kr/2013/detail.nhn?topicSeq=5
5. http://www.slideshare.net/joone/hardware-acceleration-in-webkit
6. http://dev.chromium.org/developers/design-documents/multi-process-architecture
7. https://docs.google.com/a/chromium.org/presentation/d/1pYAGn2AYJ7neFDlDZ9DmL
HpwMIskzMUXjFXYR7yfUko/edit
8. http://dev.chromium.org/developers/design-documents/inter-process-communication
9. http://dev.chromium.org/developers/design-documents/multi-process-resource-
loading
10. http://dev.chromium.org/developers/design-documents/gpu-accelerated-
compositing-in-chrome
11. http://dev.chromium.org/developers/design-documents/compositor-thread-
architecture
12. http://dev.chromium.org/developers/design-documents/impl-side-painting
13. http://blog.csdn.net/jaylinzhou/article/details/18313505
41

More Related Content

What's hot

Overview of Android binder IPC implementation
Overview of Android binder IPC implementationOverview of Android binder IPC implementation
Overview of Android binder IPC implementationChethan Pchethan
 
Android graphic system (SurfaceFlinger) : Design Pattern's perspective
Android graphic system (SurfaceFlinger) : Design Pattern's perspectiveAndroid graphic system (SurfaceFlinger) : Design Pattern's perspective
Android graphic system (SurfaceFlinger) : Design Pattern's perspectiveBin Chen
 
Learning AOSP - Android Booting Process
Learning AOSP - Android Booting ProcessLearning AOSP - Android Booting Process
Learning AOSP - Android Booting ProcessNanik Tolaram
 
Understanding the Android System Server
Understanding the Android System ServerUnderstanding the Android System Server
Understanding the Android System ServerOpersys inc.
 
React Native - Getting Started
React Native - Getting StartedReact Native - Getting Started
React Native - Getting StartedTracy Lee
 
BKK16-315 Graphics Stack Update
BKK16-315 Graphics Stack UpdateBKK16-315 Graphics Stack Update
BKK16-315 Graphics Stack UpdateLinaro
 
Scheduling in Android
Scheduling in AndroidScheduling in Android
Scheduling in AndroidOpersys inc.
 
Project meeting: Android Graphics Architecture Overview
Project meeting: Android Graphics Architecture OverviewProject meeting: Android Graphics Architecture Overview
Project meeting: Android Graphics Architecture OverviewYu-Hsin Hung
 
OVERVIEW: Chromium Source Tree
OVERVIEW: Chromium Source TreeOVERVIEW: Chromium Source Tree
OVERVIEW: Chromium Source TreeChang W. Doh
 
Android Treble: Blessing or Trouble?
Android Treble: Blessing or Trouble?Android Treble: Blessing or Trouble?
Android Treble: Blessing or Trouble?Opersys inc.
 
Android's HIDL: Treble in the HAL
Android's HIDL: Treble in the HALAndroid's HIDL: Treble in the HAL
Android's HIDL: Treble in the HALOpersys inc.
 

What's hot (20)

Overview of Android binder IPC implementation
Overview of Android binder IPC implementationOverview of Android binder IPC implementation
Overview of Android binder IPC implementation
 
Introduction to Android Window System
Introduction to Android Window SystemIntroduction to Android Window System
Introduction to Android Window System
 
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)
 
Android graphic system (SurfaceFlinger) : Design Pattern's perspective
Android graphic system (SurfaceFlinger) : Design Pattern's perspectiveAndroid graphic system (SurfaceFlinger) : Design Pattern's perspective
Android graphic system (SurfaceFlinger) : Design Pattern's perspective
 
Learning AOSP - Android Booting Process
Learning AOSP - Android Booting ProcessLearning AOSP - Android Booting Process
Learning AOSP - Android Booting Process
 
Embedded Android : System Development - Part II (Linux device drivers)
Embedded Android : System Development - Part II (Linux device drivers)Embedded Android : System Development - Part II (Linux device drivers)
Embedded Android : System Development - Part II (Linux device drivers)
 
Understanding the Android System Server
Understanding the Android System ServerUnderstanding the Android System Server
Understanding the Android System Server
 
AndroidManifest
AndroidManifestAndroidManifest
AndroidManifest
 
React Native
React NativeReact Native
React Native
 
React Native - Getting Started
React Native - Getting StartedReact Native - Getting Started
React Native - Getting Started
 
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
 
BKK16-315 Graphics Stack Update
BKK16-315 Graphics Stack UpdateBKK16-315 Graphics Stack Update
BKK16-315 Graphics Stack Update
 
React native
React nativeReact native
React native
 
Scheduling in Android
Scheduling in AndroidScheduling in Android
Scheduling in Android
 
Android Internals
Android InternalsAndroid Internals
Android Internals
 
Project meeting: Android Graphics Architecture Overview
Project meeting: Android Graphics Architecture OverviewProject meeting: Android Graphics Architecture Overview
Project meeting: Android Graphics Architecture Overview
 
OVERVIEW: Chromium Source Tree
OVERVIEW: Chromium Source TreeOVERVIEW: Chromium Source Tree
OVERVIEW: Chromium Source Tree
 
Android Treble: Blessing or Trouble?
Android Treble: Blessing or Trouble?Android Treble: Blessing or Trouble?
Android Treble: Blessing or Trouble?
 
Embedded Android : System Development - Part I
Embedded Android : System Development - Part IEmbedded Android : System Development - Part I
Embedded Android : System Development - Part I
 
Android's HIDL: Treble in the HAL
Android's HIDL: Treble in the HALAndroid's HIDL: Treble in the HAL
Android's HIDL: Treble in the HAL
 

Viewers also liked

Android chromium web view
Android chromium web viewAndroid chromium web view
Android chromium web view朋 王
 
Chrome & Webkit overview
Chrome & Webkit overviewChrome & Webkit overview
Chrome & Webkit overviewBin Chen
 
Web browser architecture
Web browser architectureWeb browser architecture
Web browser architectureNguyen Quang
 
LCU14 208- Chromium-Blink Migration for RDK
LCU14 208- Chromium-Blink Migration for RDKLCU14 208- Chromium-Blink Migration for RDK
LCU14 208- Chromium-Blink Migration for RDKLinaro
 
WebKit and Blink: Bridging the Gap Between the Kernel and the HTML5 Revolution
WebKit and Blink: Bridging the Gap Between the Kernel and the HTML5 RevolutionWebKit and Blink: Bridging the Gap Between the Kernel and the HTML5 Revolution
WebKit and Blink: Bridging the Gap Between the Kernel and the HTML5 Revolutionjuanjosanchezpenas
 
WebGL: GPU acceleration for the open web
WebGL: GPU acceleration for the open webWebGL: GPU acceleration for the open web
WebGL: GPU acceleration for the open webpjcozzi
 
Understanding Webkit Rendering
Understanding Webkit RenderingUnderstanding Webkit Rendering
Understanding Webkit RenderingAriya Hidayat
 
Architecture of the Web browser
Architecture of the Web browserArchitecture of the Web browser
Architecture of the Web browserSabin Buraga
 
Building Chromium on an Embedded Platform using Ozone-Wayland Layer (GENIVI 1...
Building Chromium on an Embedded Platform using Ozone-Wayland Layer (GENIVI 1...Building Chromium on an Embedded Platform using Ozone-Wayland Layer (GENIVI 1...
Building Chromium on an Embedded Platform using Ozone-Wayland Layer (GENIVI 1...Igalia
 
Hitea Press Article April 2014
Hitea Press Article April 2014Hitea Press Article April 2014
Hitea Press Article April 2014Jim Rowbotham
 
How is glass made (2)
How is glass made (2)How is glass made (2)
How is glass made (2)Aj Saliha
 
Thomann2015 dissertation
Thomann2015 dissertationThomann2015 dissertation
Thomann2015 dissertationOlivier Thomann
 
Embarquer Linux et des systèmes libres, méthodes et apports
Embarquer Linux et des systèmes libres, méthodes et apportsEmbarquer Linux et des systèmes libres, méthodes et apports
Embarquer Linux et des systèmes libres, méthodes et apportsguest3be047
 
Tracabilite & Identification Automatique par Bernard JEANNE-BEYLOT @JB Thèque
Tracabilite & Identification Automatique par Bernard JEANNE-BEYLOT @JB ThèqueTracabilite & Identification Automatique par Bernard JEANNE-BEYLOT @JB Thèque
Tracabilite & Identification Automatique par Bernard JEANNE-BEYLOT @JB ThèqueBernard Jeanne-Beylot
 

Viewers also liked (20)

Android chromium web view
Android chromium web viewAndroid chromium web view
Android chromium web view
 
Chrome & Webkit overview
Chrome & Webkit overviewChrome & Webkit overview
Chrome & Webkit overview
 
Web browser architecture
Web browser architectureWeb browser architecture
Web browser architecture
 
LCU14 208- Chromium-Blink Migration for RDK
LCU14 208- Chromium-Blink Migration for RDKLCU14 208- Chromium-Blink Migration for RDK
LCU14 208- Chromium-Blink Migration for RDK
 
WebKit and Blink: Bridging the Gap Between the Kernel and the HTML5 Revolution
WebKit and Blink: Bridging the Gap Between the Kernel and the HTML5 RevolutionWebKit and Blink: Bridging the Gap Between the Kernel and the HTML5 Revolution
WebKit and Blink: Bridging the Gap Between the Kernel and the HTML5 Revolution
 
Chromium ppt
Chromium pptChromium ppt
Chromium ppt
 
Android things intro
Android things introAndroid things intro
Android things intro
 
Chromium vs. Firefox
Chromium vs. FirefoxChromium vs. Firefox
Chromium vs. Firefox
 
Hardware Accelerated 2D Rendering for Android
Hardware Accelerated 2D Rendering for AndroidHardware Accelerated 2D Rendering for Android
Hardware Accelerated 2D Rendering for Android
 
WebGL: GPU acceleration for the open web
WebGL: GPU acceleration for the open webWebGL: GPU acceleration for the open web
WebGL: GPU acceleration for the open web
 
Understanding Webkit Rendering
Understanding Webkit RenderingUnderstanding Webkit Rendering
Understanding Webkit Rendering
 
Architecture of the Web browser
Architecture of the Web browserArchitecture of the Web browser
Architecture of the Web browser
 
Building Chromium on an Embedded Platform using Ozone-Wayland Layer (GENIVI 1...
Building Chromium on an Embedded Platform using Ozone-Wayland Layer (GENIVI 1...Building Chromium on an Embedded Platform using Ozone-Wayland Layer (GENIVI 1...
Building Chromium on an Embedded Platform using Ozone-Wayland Layer (GENIVI 1...
 
Hitea Press Article April 2014
Hitea Press Article April 2014Hitea Press Article April 2014
Hitea Press Article April 2014
 
How is glass made (2)
How is glass made (2)How is glass made (2)
How is glass made (2)
 
Thomann2015 dissertation
Thomann2015 dissertationThomann2015 dissertation
Thomann2015 dissertation
 
The WebKit project
The WebKit projectThe WebKit project
The WebKit project
 
Energie maison
Energie maisonEnergie maison
Energie maison
 
Embarquer Linux et des systèmes libres, méthodes et apports
Embarquer Linux et des systèmes libres, méthodes et apportsEmbarquer Linux et des systèmes libres, méthodes et apports
Embarquer Linux et des systèmes libres, méthodes et apports
 
Tracabilite & Identification Automatique par Bernard JEANNE-BEYLOT @JB Thèque
Tracabilite & Identification Automatique par Bernard JEANNE-BEYLOT @JB ThèqueTracabilite & Identification Automatique par Bernard JEANNE-BEYLOT @JB Thèque
Tracabilite & Identification Automatique par Bernard JEANNE-BEYLOT @JB Thèque
 

Similar to Android Chromium Rendering Pipeline

[D2 campus seminar]웹브라우저 엔진
[D2 campus seminar]웹브라우저 엔진[D2 campus seminar]웹브라우저 엔진
[D2 campus seminar]웹브라우저 엔진NAVER D2
 
Building a website without a webserver on Azure
Building a website without a webserver on AzureBuilding a website without a webserver on Azure
Building a website without a webserver on AzureTodd Whitehead
 
[D2 오픈세미나]2.browser engine 이형욱_20140523
[D2 오픈세미나]2.browser engine 이형욱_20140523[D2 오픈세미나]2.browser engine 이형욱_20140523
[D2 오픈세미나]2.browser engine 이형욱_20140523NAVER D2
 
Building high performing web pages
Building high performing web pagesBuilding high performing web pages
Building high performing web pagesNilesh Bafna
 
Deview 2013 mobile browser internals and trends_20131022
Deview 2013 mobile browser internals and trends_20131022Deview 2013 mobile browser internals and trends_20131022
Deview 2013 mobile browser internals and trends_20131022NAVER D2
 
Kandroid for nhn_deview_20131013_v5_final
Kandroid for nhn_deview_20131013_v5_finalKandroid for nhn_deview_20131013_v5_final
Kandroid for nhn_deview_20131013_v5_finalNAVER D2
 
JS digest. November 2017
JS digest. November 2017JS digest. November 2017
JS digest. November 2017ElifTech
 
Technical Tips: Visual Regression Testing and Environment Comparison with Bac...
Technical Tips: Visual Regression Testing and Environment Comparison with Bac...Technical Tips: Visual Regression Testing and Environment Comparison with Bac...
Technical Tips: Visual Regression Testing and Environment Comparison with Bac...Building Blocks
 
What's new in Portal and WCM 8.5
What's new in Portal and WCM 8.5What's new in Portal and WCM 8.5
What's new in Portal and WCM 8.5Vinayak Tavargeri
 
2014 HTML5 총정리
2014 HTML5 총정리2014 HTML5 총정리
2014 HTML5 총정리Wonsuk Lee
 
Grunt.js and Yeoman, Continous Integration
Grunt.js and Yeoman, Continous IntegrationGrunt.js and Yeoman, Continous Integration
Grunt.js and Yeoman, Continous IntegrationDavid Amend
 
Rendering: Or why your perfectly optimized content doesn't rank
Rendering: Or why your perfectly optimized content doesn't rankRendering: Or why your perfectly optimized content doesn't rank
Rendering: Or why your perfectly optimized content doesn't rankWeLoveSEO
 
Micro-Frontends JSVidCon
Micro-Frontends JSVidConMicro-Frontends JSVidCon
Micro-Frontends JSVidConAmir Zuker
 
Practical Performance Tips and Tricks to Make Your HTML/JavaScript Apps Faster
Practical Performance Tips and Tricks to Make Your HTML/JavaScript Apps FasterPractical Performance Tips and Tricks to Make Your HTML/JavaScript Apps Faster
Practical Performance Tips and Tricks to Make Your HTML/JavaScript Apps FasterDoris Chen
 
Grunt Continuous Development of the Front End Tier
Grunt Continuous Development of the Front End TierGrunt Continuous Development of the Front End Tier
Grunt Continuous Development of the Front End TierErick Brito
 
Browsers on Android (Webkit,chromium)
Browsers on Android (Webkit,chromium)Browsers on Android (Webkit,chromium)
Browsers on Android (Webkit,chromium)Bin Chen
 
Building reusable components as micro frontends with glimmer js and webcompo...
Building reusable components as micro frontends  with glimmer js and webcompo...Building reusable components as micro frontends  with glimmer js and webcompo...
Building reusable components as micro frontends with glimmer js and webcompo...Andrei Sebastian Cîmpean
 

Similar to Android Chromium Rendering Pipeline (20)

[D2 campus seminar]웹브라우저 엔진
[D2 campus seminar]웹브라우저 엔진[D2 campus seminar]웹브라우저 엔진
[D2 campus seminar]웹브라우저 엔진
 
Building a website without a webserver on Azure
Building a website without a webserver on AzureBuilding a website without a webserver on Azure
Building a website without a webserver on Azure
 
[D2 오픈세미나]2.browser engine 이형욱_20140523
[D2 오픈세미나]2.browser engine 이형욱_20140523[D2 오픈세미나]2.browser engine 이형욱_20140523
[D2 오픈세미나]2.browser engine 이형욱_20140523
 
Building high performing web pages
Building high performing web pagesBuilding high performing web pages
Building high performing web pages
 
#Webperf Choreography
#Webperf Choreography#Webperf Choreography
#Webperf Choreography
 
Deview 2013 mobile browser internals and trends_20131022
Deview 2013 mobile browser internals and trends_20131022Deview 2013 mobile browser internals and trends_20131022
Deview 2013 mobile browser internals and trends_20131022
 
Kandroid for nhn_deview_20131013_v5_final
Kandroid for nhn_deview_20131013_v5_finalKandroid for nhn_deview_20131013_v5_final
Kandroid for nhn_deview_20131013_v5_final
 
JS digest. November 2017
JS digest. November 2017JS digest. November 2017
JS digest. November 2017
 
Technical Tips: Visual Regression Testing and Environment Comparison with Bac...
Technical Tips: Visual Regression Testing and Environment Comparison with Bac...Technical Tips: Visual Regression Testing and Environment Comparison with Bac...
Technical Tips: Visual Regression Testing and Environment Comparison with Bac...
 
What's new in Portal and WCM 8.5
What's new in Portal and WCM 8.5What's new in Portal and WCM 8.5
What's new in Portal and WCM 8.5
 
Transforming the web into a real application platform
Transforming the web into a real application platformTransforming the web into a real application platform
Transforming the web into a real application platform
 
2014 HTML5 총정리
2014 HTML5 총정리2014 HTML5 총정리
2014 HTML5 총정리
 
Grunt.js and Yeoman, Continous Integration
Grunt.js and Yeoman, Continous IntegrationGrunt.js and Yeoman, Continous Integration
Grunt.js and Yeoman, Continous Integration
 
Rendering: Or why your perfectly optimized content doesn't rank
Rendering: Or why your perfectly optimized content doesn't rankRendering: Or why your perfectly optimized content doesn't rank
Rendering: Or why your perfectly optimized content doesn't rank
 
Micro-Frontends JSVidCon
Micro-Frontends JSVidConMicro-Frontends JSVidCon
Micro-Frontends JSVidCon
 
Practical Performance Tips and Tricks to Make Your HTML/JavaScript Apps Faster
Practical Performance Tips and Tricks to Make Your HTML/JavaScript Apps FasterPractical Performance Tips and Tricks to Make Your HTML/JavaScript Apps Faster
Practical Performance Tips and Tricks to Make Your HTML/JavaScript Apps Faster
 
micro-frontends-with-vuejs
micro-frontends-with-vuejsmicro-frontends-with-vuejs
micro-frontends-with-vuejs
 
Grunt Continuous Development of the Front End Tier
Grunt Continuous Development of the Front End TierGrunt Continuous Development of the Front End Tier
Grunt Continuous Development of the Front End Tier
 
Browsers on Android (Webkit,chromium)
Browsers on Android (Webkit,chromium)Browsers on Android (Webkit,chromium)
Browsers on Android (Webkit,chromium)
 
Building reusable components as micro frontends with glimmer js and webcompo...
Building reusable components as micro frontends  with glimmer js and webcompo...Building reusable components as micro frontends  with glimmer js and webcompo...
Building reusable components as micro frontends with glimmer js and webcompo...
 

Recently uploaded

home automation using Arduino by Aditya Prasad
home automation using Arduino by Aditya Prasadhome automation using Arduino by Aditya Prasad
home automation using Arduino by Aditya Prasadaditya806802
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...asadnawaz62
 
Engineering Drawing section of solid
Engineering Drawing     section of solidEngineering Drawing     section of solid
Engineering Drawing section of solidnamansinghjarodiya
 
Main Memory Management in Operating System
Main Memory Management in Operating SystemMain Memory Management in Operating System
Main Memory Management in Operating SystemRashmi Bhat
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)Dr SOUNDIRARAJ N
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...Erbil Polytechnic University
 
Correctly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleCorrectly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleAlluxio, Inc.
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfAsst.prof M.Gokilavani
 
Internet of things -Arshdeep Bahga .pptx
Internet of things -Arshdeep Bahga .pptxInternet of things -Arshdeep Bahga .pptx
Internet of things -Arshdeep Bahga .pptxVelmuruganTECE
 
Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...121011101441
 
Configuration of IoT devices - Systems managament
Configuration of IoT devices - Systems managamentConfiguration of IoT devices - Systems managament
Configuration of IoT devices - Systems managamentBharaniDharan195623
 
Indian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptIndian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptMadan Karki
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
Virtual memory management in Operating System
Virtual memory management in Operating SystemVirtual memory management in Operating System
Virtual memory management in Operating SystemRashmi Bhat
 
Energy Awareness training ppt for manufacturing process.pptx
Energy Awareness training ppt for manufacturing process.pptxEnergy Awareness training ppt for manufacturing process.pptx
Energy Awareness training ppt for manufacturing process.pptxsiddharthjain2303
 
Ch10-Global Supply Chain - Cadena de Suministro.pdf
Ch10-Global Supply Chain - Cadena de Suministro.pdfCh10-Global Supply Chain - Cadena de Suministro.pdf
Ch10-Global Supply Chain - Cadena de Suministro.pdfChristianCDAM
 
welding defects observed during the welding
welding defects observed during the weldingwelding defects observed during the welding
welding defects observed during the weldingMuhammadUzairLiaqat
 

Recently uploaded (20)

home automation using Arduino by Aditya Prasad
home automation using Arduino by Aditya Prasadhome automation using Arduino by Aditya Prasad
home automation using Arduino by Aditya Prasad
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...
 
Engineering Drawing section of solid
Engineering Drawing     section of solidEngineering Drawing     section of solid
Engineering Drawing section of solid
 
Main Memory Management in Operating System
Main Memory Management in Operating SystemMain Memory Management in Operating System
Main Memory Management in Operating System
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
 
POWER SYSTEMS-1 Complete notes examples
POWER SYSTEMS-1 Complete notes  examplesPOWER SYSTEMS-1 Complete notes  examples
POWER SYSTEMS-1 Complete notes examples
 
Correctly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleCorrectly Loading Incremental Data at Scale
Correctly Loading Incremental Data at Scale
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
 
Internet of things -Arshdeep Bahga .pptx
Internet of things -Arshdeep Bahga .pptxInternet of things -Arshdeep Bahga .pptx
Internet of things -Arshdeep Bahga .pptx
 
Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...
 
Configuration of IoT devices - Systems managament
Configuration of IoT devices - Systems managamentConfiguration of IoT devices - Systems managament
Configuration of IoT devices - Systems managament
 
Indian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptIndian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.ppt
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
Virtual memory management in Operating System
Virtual memory management in Operating SystemVirtual memory management in Operating System
Virtual memory management in Operating System
 
Energy Awareness training ppt for manufacturing process.pptx
Energy Awareness training ppt for manufacturing process.pptxEnergy Awareness training ppt for manufacturing process.pptx
Energy Awareness training ppt for manufacturing process.pptx
 
Ch10-Global Supply Chain - Cadena de Suministro.pdf
Ch10-Global Supply Chain - Cadena de Suministro.pdfCh10-Global Supply Chain - Cadena de Suministro.pdf
Ch10-Global Supply Chain - Cadena de Suministro.pdf
 
welding defects observed during the welding
welding defects observed during the weldingwelding defects observed during the welding
welding defects observed during the welding
 

Android Chromium Rendering Pipeline

  • 1. Android Chromium Rendering Pipeline 이형욱 (hyungwook.lee@navercorp.com) 시스템스컴퓨팅G / NAVER LABS 2015-04
  • 2. 2 0. Contents Chapter 1: 브라우저 렌더링에서의 Critical Path란 무엇인가? ① Summary of browser’s main flows ② HTML Parser ③ JavaScriptEngine ④ Render Tree, Layout ⑤ Rendering Pipeline Runs on Main Thread ⑥ New Rendering Model ⑦ GPU Accelerated Compositing Chapter 2: Chromium은 렌더링 성능 향상을 위하여… ① Chrome Vs Chromium ② Why Multi Process Architecture? ③ GPU Process ④ Multi Threads Models in Renderer Process ⑤ Chromium Scheduler: Right things right time Chapter 3: Chromium-powered Android WebView ① What is Android WebView? ② Android WebView Version History ③ Chromium Powered WebView Structure ④ Chrome Vs Android Rendering model ⑤ Chrome Vs Chromium WebView ⑥ Chromium WebView Rendering Pipeline ⑦ The Future of WebView?
  • 3. 3 Chapter 1, 브라우저 렌더링에 서의 Critical Path란 무엇인가?
  • 4. 4 <html> <head> <title> NAVER </title> </head> <body> <div> <h1> Hello </h1> <p> World </p> </div> </body> </html> 1. Summary of browser main flows. [Source: How browsers work]
  • 5. 5 HEAD TITLE NAVER BODY DIV H1 P HTML Hello World <html> <head> <title> NAVER </title> </head> <body> <div> <h1> Hello </h1> <p> World </p> </div> </body> </html> 2. HTML Parser
  • 6. 6 3. Java Script Engine Source Code Parser Syntax Tree Bytecode Generator Bytecode JIT Compiler Machine Code Execution Loader Parser DOM Java Script HTML DOM API Evaluate
  • 9. 9 6. Layout HEAD TITLE NAVER BODY DIV H1 P HTML Hello World Block Block Block Block Block Inline Inline (0, 0, 1024, 768) (0, 0, 1024, 768) (0, 0, 1024, 55) (10, 20, 1024, 37) (10, 80, 1024, 18)
  • 10. 10 7. Rendering Block (html) Block (body) Block (div) Block (h1) Block (p) Inline (hello) Inline (world) (0, 0, 1024, 768) (0, 0, 1024, 768) (0, 0, 1024, 55) (10, 20, 1024, 37) (10, 80, 1024, 18) 1024 768<div>
  • 11. 11 8. Rendering Pipeline Runs on Main Thread [Source: Blink Rendering Pipeline] [Source: Chrome Graphics - BlinkOn 1]
  • 12. 12 9. New Rendering Model: Layers (1/4) [Source: WebKit.org]
  • 13. 13 9. New Rendering Model: Layers (2/4) 1. Avoid unnecessary repainting - If yellow and red have their own layers, then nothing needs "repainting" while this example animates. 2. Makes some features more efficient or practical - Including: Scrolling, 3D CSS(translate3d, …), opacity, filters, WebGL, etc. [Source: Compositing in Blink and WebKit]
  • 14. 14 9. New Rendering Model: Layers (3/4) 1. It's the root object for the page. <html> 2. CSS position properties (relative, absolute) 3. Has overflow, an alpha mask or reflection 4. CSS filter 5. CSS 3D Transform , Animations 6. <canvas>, <video> 7. will-change (Chrome 36, Firefox 36, Opera 24)
  • 15. 15 Cost of Multi Layers: Memory, Computing <Layer를 너무 많이 사용할 경우 Compositing 시간이 오래 걸림> 9. New Rendering Model: Layers (4/4)
  • 16. 16 10. GPU Accelerated Compositing 1. 각 Layer 별 bitmap을 생성 (Render Layer traversing) 2. Text와 Image는 CPU에서 Rasterization 3. Textures upload into Video memory 4. Compositor에서 Layer 순서에 맞게 Texture를 drawing하여 화면에 Update
  • 17. 17 Chapter 2, Chromium은 렌더 링 성능 향상을 위하여 어떤 기 술들을 사용하고 있는가?
  • 18. 18 Google Chrome Chromium Logo Colorful Blue Crash reporting Yes, if you turn it on None User metrics Yes, if you turn it on No Video and audio tags AAC, MP3, Vorbis and Theora Vorbis and Theora by default Adobe Flash custom (non-free) plugin included in release supports NPAPI plugins, including the one from Adobe PDF support custom (non-free) plugin included in release downloads and displays with system PDF viewer Code Tested by Chrome developers May be modified by distributions Sandbox Always on Depending on the distribution Quality Assurance New releases are tested before sending to users Depending on the distribution 1. Chrome Vs Chromium
  • 19. 19 2. Why Multi Process Architecture? 기존 브라우저의 문제점 • 현재(크롬 제작 당시)의 브라우저는 과거의 OS와 비슷한 구조 • 과거의 OS는 단일 사용자, 협조적 멀티 태스킹 시스템 • 이와 같은 시스템에서, 어떤 어플리케이션의 문제는 OS 전체의 안정성에 영향을 미침 • 단일 프로세스 모델의 브라우저에서는 한 페이지의 문제가 브라우저 전체에 문제를 일으킴 문제해결을 위한 접근 • 절대적으로 안정적인 렌더링 엔진을 만드는 것은 거의 불가능함 • 최근의 OS는 각 어플리케이션을 고립시킴으로써 특정 어플리케이션의 문제가 시스템 전체의 안정 성에 영향을 미치지 않도록 하며, 사용자 각자의 데이터를 보호하고 있음
  • 20. 20 3. Chromium Rendering Pipeline [Source: Chrome Graphics - BlinkOn 1]
  • 21. 21 • GPU Process의 구조적 특징: Security, Robustness, Uniformity, Parallelism • Client(Render Process): GL Command를 생성, Ring Buffer에 Insert -> 일반적인 페이지의 경우 Texture Upload용으로 사용, HTML5 Canvas / WebGL은 직접 GL Command를 사용 • Server(GPU Process): Command를 fetch, execution. • GL command는 GL ES 2.0 API와 거의 유사한 Async command 4. GPU Process [Source: GPU Accelerated Compositing in Chrome]
  • 22. 22 5. Multi Threads: Main Thread Rendering [Source: Chrome Graphics - BlinkOn 1]
  • 23. 23 5. Multi Threads: Threaded Compositor [Source: Chrome Graphics - BlinkOn 1]
  • 24. 24 5. Multi Threads: Threaded Rasterization [Source: Chrome Graphics - BlinkOn 1]
  • 25. 25 6. Skia’s SkPicture Canvas A modern 2D graphics library SkPicture, SkPicturePlayBack: Records and replay draw operations. [http://www.dorothybrowser.com/parallelizing-canvas-rendering/]
  • 26. 26 7. Chromium Rendering Pipeline in detail 1. Record 2. Raster 2.5 Upload 3. Composite update record Thread Proxy update recordPicture Layer updatePicture LayerImpl Raster LayerTreeHost update recordupdate recordGraphics Layer Blink LayerTreeHostImpl Proxy Main Thread Compositor Thread Raster Threads Call into WebKit which calls Skia SkPicture records the paint for deferred raster Decode images In parallel Raster into shared memory Send to GPU process using custom extension GPU process does glTexImage2d asynchronously Send draw cmds To GPU Process over command buffer glBindTexture glDrawElements Main Thread Raster Thread Compositor Thread Tree Sync
  • 27. 27 8. Chromium Scheduler: Right things right time 1. Record 3. Raster 4. Upload 5. Composite 2. Tree Sync 6. SwapBuffer Scheduler Begin Frame Commit Pending Tree Draw & Swap Buffer Update Visible Tiles <StateMachine in Compositor Threads> Activate Pending Tree VSync
  • 28. 28 Renderer Process Cache Thread File Thread DB Thread IO Thread I/O Thread Browser Process Main Thread Renderer Process IPC RenderView RenderWidget Blink RenderView RenderWidget RenderWidget Blink Blink RenderView WebContents RenderViewHost Manager RenderViewHost RenderWidgetHost RenderViewHost RenderWidgetHost RenderViewHost RenderWidgetHost SiteInstance RenderProcessHost SiteInstance RenderProcessHost Main ThreadMain Thread WebContents RenderViewHost Manager RenderMainThread (Single Process Mode) 1 2 3 4 5 6 Compositor GPU Thread (Android) Process Launcher Thread Raster I/O Thread Compositor Raster 9. Chromium Architecture in detail
  • 29. 29 Chapter 3, Android Chrome과 Chromium-powered WebView 의 구조적 차이는 무엇인가?
  • 30. 30 1. What is Android WebView? Web content in a box: - Powers browsers such as AOSP Browser - Displays almost all mobile banner ads - Can be used to create portable HTML-based apps - Often intermixed imperceptibly with native Views <- Android View <- Android WebView
  • 31. 31 2. Android WebView Version History Android <= J: custom WebKit-based “classic” WebView Android K: Chromium 30 / 33-based WebView Android L: Unbundled Evergreen WebView http://com.odroid.com/sigong/nf_file_board/nfile_board_view.php?keyword=&tag= ODROID-U3&bid=214 http://www.ibtimes.co.uk/moto-g-finally-tastes-android-5-0-lollipop-via-cyanogenmod-12-unofficial- build-1475895
  • 32. 32 3. Chromium Powered WebView Structure Blink(WebKit) Content (Multi-process-impl) Content API Blink Chromium Android WebView Framework Chrome Browser Framework
  • 33. 33 4. Chrome Vs Android Rendering Model Make main thread free Make sure contents on time
  • 34. 34 5. Chrome Vs Chromium WebView Chrome Multi-process  UI thread  GPU thread  Texture upload thread  Per renderer process: o Blink thread o CC impl thread o Raster thread Chromium Scheduler SurfaceView Chromium WebView Single-process  Combined UI + renderer CC thread  Android RenderThread (+in-proces s GPU thread)  Canvas/WebGL GPU thread  Blink thread  Raster thread Android Rendering Scheduer Draw functor (Private API) [Source: Android WebView rendering BlinkOn 3]
  • 35. 35 6. Accelerated Android Rendering [Source: http://www.slideshare.net/deview/1d6review-of-android-l-developer-preview] [MainThread]
  • 36. 36 7. Chromium WebView Rendering Pipeline in K DrawGLFunction() Synchronous Compositor ViewRootImpl performDraw() View Draw(Canvas) View onDraw(Canvas) HardwareCanvas draw*(…,Paint) WebView::onDraw() Set draw functor via DrawGLFunctor::requestDrawGL() (canvas.callDrawGLFunction(mNativeDrawGLFunctor)) 3. Composite Chromium WebView 1. Record 2. Raster Main Blink Thread Raster Threads Main Thread
  • 37. 37 8. Chromium WebView Rendering Pipeline in L WebView::onDraw() 1. Set draw functor 2. Request Record & Raster Synchronous Compositor View onDraw(Canvas) HardwareCanvas draw*(…,Paint) Chromium WebView 1. Record 2. Raster Main Raster Threads ViewRootImpl performDraw() Render Blink Thread DrawGLFunction() Synchronous Compositor 3. Composite Render Thread
  • 38. 38 9. Android Chromium WebView Architecture Blink Thread Cache Thread File Thread DB Thread IO Thread Main Thread IPC WebContents RenderViewHost Manager RenderViewHost RenderWidgetHost RenderViewHost RenderWidgetHost RenderViewHost RenderWidgetHost SiteInstance RenderProcessHost SiteInstance RenderProcessHost Chromium WebView’s Process RenderView RenderWidget Blink Process Launcher Thread Raster Thread WebView
  • 39. 39 10. The Future of WebView? “Under active debate at the moment” (2014/11) 1. Opposing use cases 1) WebView as a browser-in-a-box, Vs 2) WebView as one tool in a hybrid app toolset 2. Opposing update priorities 1) App developers want the latest features and performance improvements 2) They also want stability to the point of bug-for-bug compatibility [Source: Android WebView rendering BlinkOn 3]
  • 40. 40 Appendix #1: References 1. http://www.w3.org/TR/CSS2/ 2. http://www.w3.org/TR/DOM-Level-2-Core/core.html 3. http://www.html5rocks.com/en/tutorials/internals/howbrowserswork/ 4. http://deview.kr/2013/detail.nhn?topicSeq=5 5. http://www.slideshare.net/joone/hardware-acceleration-in-webkit 6. http://dev.chromium.org/developers/design-documents/multi-process-architecture 7. https://docs.google.com/a/chromium.org/presentation/d/1pYAGn2AYJ7neFDlDZ9DmL HpwMIskzMUXjFXYR7yfUko/edit 8. http://dev.chromium.org/developers/design-documents/inter-process-communication 9. http://dev.chromium.org/developers/design-documents/multi-process-resource- loading 10. http://dev.chromium.org/developers/design-documents/gpu-accelerated- compositing-in-chrome 11. http://dev.chromium.org/developers/design-documents/compositor-thread- architecture 12. http://dev.chromium.org/developers/design-documents/impl-side-painting 13. http://blog.csdn.net/jaylinzhou/article/details/18313505
  • 41. 41