17
August 9, 2015 GOTHENBURG Zero-Copy Compositing in WebKitGTK+ for GUADEC 2015 Gwang Yoon Hwang ([email protected])

Zero-Copy Compositing in WebKitGTK+ for GUADEC 2015 (GUADEC 2015)

  • Upload
    igalia

  • View
    531

  • Download
    0

Embed Size (px)

Citation preview

August 9, 2015 GOTHENBURG

Zero-Copy Compositing in WebKitGTK+ forGUADEC 2015

Gwang Yoon Hwang ([email protected])

Zero-Copy Compositing in WebKitGTK+ for GUADEC 2015 2

Who am I?

I Gwang Yoon HwangI Hacker in Igalia, S. L.I Working on WebKit Project, focused on rendering performance of WebKitGTK+ in

embedded environment

Zero-Copy Compositing in WebKitGTK+ for GUADEC 2015 3

Accelerated Compositing

Zero-Copy Compositing in WebKitGTK+ for GUADEC 2015 4

Figure 1: Concept of Accelerated Compositing

Zero-Copy Compositing in WebKitGTK+ for GUADEC 2015 5

Unfortunatly, it was not enough

I The main-thread is always busy (Parsing, Layout, JS . . . )I The main-thread can be blocked by VSyncI And we want awesome webpages which uses HTML5 features

Zero-Copy Compositing in WebKitGTK+ for GUADEC 2015 6

Off-the-main-thread Compositing

Zero-Copy Compositing in WebKitGTK+ for GUADEC 2015 7

Figure 2: Concept of Off-the-main-thread compositing

Zero-Copy Compositing in WebKitGTK+ for GUADEC 2015 8

Compositing in the dedicated thread / or process

I The main-thread don’t have to care about Vsync and compositing operationsI It shows more smooth CSS animations, zoom, and scale operations.

Zero-Copy Compositing in WebKitGTK+ for GUADEC 2015 9

What we are (going to) using: Coordinated Graphics

I It implement a dedicated compositing thread in WebProcess or UIProcess.I Depends on OpenGL[ES] only: Easy to port to other enviroment

Zero-Copy Compositing in WebKitGTK+ for GUADEC 2015 10

Figure 3: Coordinated Graphics: Model

Zero-Copy Compositing in WebKitGTK+ for GUADEC 2015 11

Unfortunatly, it is not enough

I Texture Uploading: Upload rasterized bitmaps to textures for normal contentsI texture to texture copy: Pass rendered results from WebGL or Canvas to the

compositorI Even worse if we need to share textures across processes

Zero-Copy Compositing in WebKitGTK+ for GUADEC 2015 12

Toward to Zero-Copy Compositing in WebKitGTK+

Zero-Copy Compositing in WebKitGTK+ for GUADEC 2015 13

Reduce texture uploading

I We can rasterize contents to textures if we are using cairo-glI However, it is not silver bulletI For example: if you render a webpage with complex asian characters..I Needs more investigations and tests

Zero-Copy Compositing in WebKitGTK+ for GUADEC 2015 14

Remove texture copy

I We can remove copies in Coordinated Graphics with Threaded mode (a.k.a.Threaded Compositor)

I For HTML5 Video and HTML5 WebGL, we don’t have to use copy operations at all.I For HTML5 2D Canvas, we need to preserve copy operation to support

accumulated rendering.

Zero-Copy Compositing in WebKitGTK+ for GUADEC 2015 15

Figure 4: Compositing Platform layers

Zero-Copy Compositing in WebKitGTK+ for GUADEC 2015 16

Current Status and Future

Zero-Copy Compositing in WebKitGTK+ for GUADEC 2015 17

I You can build WebKitGTK+ with a –threaded-compositor flagI However, It doesn’t support WebGL, Canvas and Video yetI Most of codes to support those features are ready, however we need to test it

seriously before using it as a default