Changes

Jump to: navigation, search

Platform/GFX/OffMainThreadCompositing

150 bytes added, 15:05, 22 June 2013
no edit summary
=Current status=
Running Shipped on Android and FirefoxOS.Usable on Linux and Mac, currently fixing Android bugs(buggy and off by default).Work in progress on Windows.
=Goals=
The main goal is to improve responsiveness. In this architecture has the longer term, goals includefollowing advantages over our on-the-main-thread approach:
* Reduce main thread contention
* Asynchronous scrolling
=Design=
[[File:gfx-layers-architectureLayersRefactoring.png|thumb|650px|Gfx layers class diagram]]
A new thread will handle composition. This thread will receive updates from the content thread, much as the chrome process receives updates from the content process in e10s. Indeed, as much as possible, the shadow layers machinery developed for e10s will be adapted for off-main-thread compositing. The design may need to diverge in some places from the e10s approach: for example, on Android, updates from the content thread to the compositing thread need to be asynchronous. ('''note''': With the current code ... this might not be the case with the new frontend, and even in the current code, the cases that require async PLayers could be fixed at the widget/android level too. We'll need to make a tradeoff.)
=Plan=
Our highest priority platform for this project has been Androidmobile platforms, but we want to extend this to all supported platforms: Mac, Windows (D3D9 + D3D10), Linux, B2G (Gonk) and software-only (BasicLayers; possibly, there is ongoing discussion as to whether this is the best use of resources to improve the experience for 'low-end' users).
==Current status==
* Only scrolling is asynchronous/off main thread. All other features require further work.
=== Operating systems ===
* Androidand B2G: Released. We continue to iron out OMTC bugs as the Android test base expands, but we are already quite high-quality.
* OS X: {{bug|756601}} Alpha quality. We began development of OMTC on this platform, but we haven't worked on it much since then. It pretty much works but is disabled by default.
* Linux: {{bug|722012}} In initial implementation stages. We're still sorting out basic issues with X and GL, as we don't support OMTC with BasicLayers yet.
* B2G (Gonk): {{bug|741837}} Alpha quality. The B2G team has been working on getting it enabled and working through the implementation.
* BasicLayers (software only): {{bug|703484}} In initial implementation stages. Marco Castelluccio, a volunteer contributor, is working through implementing off-main-thread BasicLayers, which also involves making our Cairo library thread-safe.
* Windows:
** Direct3D 10: {{bug|756606}} Not started yetWork in progress; has some fundamental problems with textures which require the layers refactoring.** Direct3D 9: {{bug|756608}} Not started yetWork in progress; but, in theory, should be fairly straightforward (there are already shadow layers implemented, but I don't think they are used anywhere).
==Future Work==
===WebGL===
Currently, we read The WebGL streaming buffer project helped improve our WebGL content back from the graphics cardcompositing performances.Even though there is stil some work in progress, and then send it to most of the compositor. This is terrible for performancework has landed already.* Sharing WebGL backing textures between threads {{bug|728524}} will let lets us avoid reading back.* Double-buffering WebGL {{bug|716859}} will let lets us hand off a texture to the compositor, then go back to drawing to the WebGL context.
* Not using glFinish() to synchronize between threads {{bug|697831}} (most likely using the ARB_sync extension) will let us hand those textures off faster.
'''Assignee''': Jeff Giblert, Cody Brocious (Daeken)<br>'''Status''': Being workedMostly done
===Video===
Video decoding is already off-main-thread, but it needs a synchronization point between the Gecko thread The video pipeline can now decode and the composite video thread to publish decoded frames. We need to be able to publish frames directly to without touching the compositor content thread(async-video). To improve performances and audio/video synchronization, never involving there is some work in adding synchronization logic on the main threadcompositor side.* Asynchronous video composition (already landed) is {{bug|706172}}
'''Assignee''': Nicolas Silva (nical)<br>
'''Status''': Blocked on Linux implementation of OMTCasync-video done, improvements planned.
===CSS Animations===
* {{bug|717872}}
'''Assignee''': UNASSIGNEDJoe Drew <br>'''Status''': No work doneWork in progress
===Off-main-thread layers implementations===
==== Layers refactoring ====
The layers system has been heavily refactored to more easily facilitate OMTC on all platforms.
We are currently refactoring the layers system to more easily facilitate OMTC. The biggest changes are to the compositing side, and to how textures/buffers/handles are passed between the drawing and compositing components. The aim is for most OMTC code to be backend-independent. Compositing will be is done by a Compositor class (rather than the ShadowLayerManager, which will still have responsibility for managing the shadow layer tree). There will be are backend-specific compositor sub-classes, but the shadow layer tree and it's manager should be are backend-independent. Buffers/textures will be are handled by a TextureClient/TextureHost pair pairs which will have backend-specific subclasses and will handle all inter-thread communication. The layer classes can then be agnostic about backend and IPC mechanism. The [https://wiki.mozilla.org/Gecko:Overview#Graphics Gecko overview] wiki page contains good documentation about the current (post refactoring) layers system.
==== Android ====
'''Assignee''': Benoit Girard/Ali Juma<br>
'''Status''': Beta qualityShipped
==== Mac OS X ====
'''Assignee''': UNASSIGNED<br>
'''Status''': Alpha Beta quality
==== Linux ====
'''Assignee''': Nicolas Silva<br>
'''Status''': In development, testable but buggy not optimized.
==== Direct3D 9 ====
'''Assignee''': UNASSIGNEDNick Cameron<br>'''Status''': No work doneIn development
==== Direct3D 10 ====
'''Assignee''': UNASSIGNEDBas Schouten<br>'''Status''': No work doneAlpha quality
==== Basic (Software-only) ====
=Development=
Development is happening on mozilla-central and the graphics branch (layers refactoring).
=Test cases=
http://people.mozilla.com/~ajuma/omtc/
Confirm
137
edits

Navigation menu