11.01.2019

On Mac, the terms “browser compositor”, “Ubercompositor”, and “delegated rendering” refer to the same thing. I will try to use “delegated rendering” to refer to this change in this document. This document describes the implementation of delegated rendering on the Mac. Throughout this document, I will try to color-code the data structures and functions by the process that they are in. Things in the renderer process are red, things in the browser process are blue, and things in the GPU process are green. Table of Contents. Contents • • • • • • • Delegated Rendering in Aura (Windows, Linux, Chrome OS) In Aura, the entire browser window is a single OpenGL surface.

Everything that is drawn in that window (including the tab strip, the address bar, the min/max/close buttons) is drawn using OpenGL into that single OpenGL surface. Inside the browser process, inside the aura::WindowTreeHost, there exists a ui::Compositor (which is a wrapper around a cc::LayerTreeHost ). This ui::Compositor generates, via its cc::LayerTreeHost, the actual OpenGL commands to be executed in the GPU process, to produce the pixels that appear in that OpenGL surface, for the whole window. Inside the renderer process, there exists another cc::LayerTreeHost which decides what is to be drawn for the web contents area. Instead of outputting pixels directly (know as “direct rendering”), this cc::LayerTreeHost outputs instructions for how to draw those pixels (in the form of a list of textured quads), which it sends the browser process, which adds those quads to the things it will draw inside its ui::Compositor. In this sense, the renderer has delegated producing actual pixels to the browser process, hence “delegated rendering”, as opposed to “direct rendering”. I have license for microsoft word but i need to download it mac. These concepts of “direct” versus “delegating” are made concrete in the cc::Renderer implementations -- there exists a cc::DelegatingRenderer for delegated rendering, and there exists a cc::DirectRenderer for direct rendering (with cc::GLRenderer for OpenGL-accelerated rendering and a cc::SoftwareRender for software rendering).

Of note is that the browser process’ compositor is a direct renderer, while the renderer process’ compositor is a delegating renderer. Note on power+performance: In the Aura case, in the initial implementation (I think, this may be a lie), the renderer process used a direct renderer (rendering to a texture), and then we would draw the resulting image in the browser process’ direct renderer. Best photography editing app. This is bad for performance and power in that it uses up to 2x-3x the memory bandwidth to draw a single frame -- [write pixel in renderer] then [read pixels in browser] then [write pixels in browser] versus just [write pixels in browser]. I say 2x-3x, because both of those pipelines often involve a [read pixels from tile textures] stage, which makes it more 2x than 3x (other work also makes the improvement less dramatic). Delegated Rendering on Mac On Mac, only the web contents part of the browser window is an OpenGL surface drawn by Chrome.

Chrome

(WebGL) How to Enable Native OpenGL in your Browser (Windows) 2013/06/11 JeGX By default, both Firefox and Chrome use the ANGLE layer to render WebGL draw calls under Windows.

The rest of the window is drawn using Cocoa, the native Mac UI API. This is because we don’t (yet) have a way to draw a native-feeling Mac UI using Aura. There is a project underway to do this (starting with non-browser-window UI such as task manager and app launcher). Where the Actual ui::Compositor Lives on Mac Recall that in Aura, the aura::WindowTreeHost had the ui::Compositor which would draw the web contents (among other things). On Mac, we don’t have any such analogous place to put the ui::Compositor. Creating and destroying a ui::Compositor is very expensive (you have to set up a GPU command buffer, among other beasts), and keeping one around isn’t cheap either.

Java for chrome mac

One option would be that we could just hang the ui::Compositor off of the RenderWidgetHostViewCocoa (the NSView that displays web contents), but this would be one-or-more- ui::Compositor s-per-tab, which would make creating and destroying tabs slow, and make tabs bloated. Instead there is a BrowserCompositorCALayerTree class, which owns the ui::Compositor and a sub-tree of CALayer s which draw the contents of the ui::Compositor. This class can be recycled across different NSView s as needed. There is at most one spare instance of BrowserCompositorCALayerTree kept around for recycling. When a RenderWidgetHostViewCocoa is made visible, it creates a BrowserCompositorViewMac, which finds or creates a spare BrowserCompositorCALayerTree, and binds to that.

The binding involves adding the CALayer s of the BrowserCompositorCALayerTree to the CALayer tree backing the NSView. When the RenderWidgetHostViewCocoa is made invisible, it frees its BrowserCompositorViewMac, which allows the bound BrowserCompositorCALayerTree to either hang out and try to be recycled, or delete itself.