Graphics Architecture

Overview

Each Aura Window owns a corresponding compositor layer. The layer tree corresponds roughly to the window tree (though Views also supports layers, so a single Aura Window can have nested Layers created by Views within that Window).
 
If the Window's layer has a texture that texture is drawn by the compositor. Aura is transitioning to using the Chromium Compositor ("CC"). At time of writing CC is part of WebKit, but there is a nascent effort to extract it into its own library within Chromium.
 
The Compositor maintains two trees of layers, one on the UI thread and one (optionally) on the Compositor thread. This improves performance for animations and interactive events like scrolling. See CC documentation for more information. The CC library talks to the GPU process via command buffer to do the final rendered output.

Pre-Layer Tree Unification World

At the time of writing we have two layer trees, one for the UI and one for content from the renderer process. The renderer process uses WebLayer directly, while the UI wraps it in a class ui::Layer in ui/compositor, which provides some additional utilities useful to Aura and Views.
 
Once CC is extracted into a standalone library we will explore replacing ui::Layer functionality with direct use of CCLayer.

Paint Scheduling/Draw Flow

Throughout these documents and in the source code you will see references to paint and draw. Paint is an operation performed mostly by the Views system to update the contents of the windows... this is a typically a software operation to update the contents of a Skia canvas. Draw is an operation performed by the compositor to draw the contents of layers' textures to the screen, including potentially compositing some of them against each other.
 

A draw can be triggered by two sources: the underlying native window owned by the RootWindowHost can be sent a redraw notification from the system (e.g. WM_PAINT or Expose), or an application event can trigger a redraw by calling ScheduleDraw() on any number of framework objects (Compositor, RootWindow, etc). In the latter case a task is posted that calls Draw().

 
Layer also supports a method SchedulePaint(), which is exposed through Window and also NativeWidgetAura and used by Views when some sub-region of the layer is to be marked invalid. The layer stores the current invalid rect which is a union of all invalid rects specified since the last validation.
 
When the compositor draws, it performs a depth-first walk of the layer tree, and if any of the layers it encounters has an invalid rectangle, it is asked to repaint its contents. The compositor does this via WebKit::WebContentLayerClient, implemented by ui::Layer. The layer asks its delegate to repaint via a call of OnPaintLayer() which takes a Skia canvas sized to the invalid rect. In Aura, the delegate is the Window, and the Window asks its delegate to repaint. In production this is often a NativeWidgetAura, a Views type. As mentioned earlier, Views can also have layers directly, and as such a View can also be a layer's delegate.
 
Once the draw is complete the invalid region is validated so no further paint notifications are sent until explicitly requested by a subsequent invalidation.

最新文章

  1. Storm中遇到的日志多次重写问题(一)
  2. php array 分页
  3. ASP.NET MVC铵钮Click后下载文件
  4. noi题库(noi.openjudge.cn) 1.8编程基础之多维数组T11——T20
  5. IOS-UITextField-全解
  6. Indoor Positioning System & Real time location system
  7. 用word2013写博客
  8. 正确的 zip 压缩与解压代码
  9. rhel5.8 ISO yum源配置
  10. Linux命令-基本命令(1)
  11. HTML资源定位器-URL
  12. 计蒜客 无脑博士 bfs
  13. Redis扩展机制
  14. windows系统,boost编译安装
  15. 假如有Thread1、Thread2、Thread3、Thread4四条线程分别统计C、D、E、F四个盘的大小
  16. Flask、Celery、RabbitMQ学习计划
  17. C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\文件不断增长,如何处理?
  18. Mac-OSX下Ruby更新
  19. POJ-3273(二分)
  20. js&jquery避免报错的方法

热门文章

  1. javaweb学习总结(六)——Servlet开发(三) 常见问题疑问
  2. org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files (x86)\Java\jdk1.7.0_7
  3. 转:IE 无法使用 js trim() 的解决方法
  4. hiho 1613 - 墨水滴 - bfs+优先队列 *
  5. 3ds Max 设置中文界面
  6. Matlab从入门到精通 Chapter5 数据可视化--
  7. c的面向对象思想记录
  8. 紫书 例题 10-4 UVa 10791(唯一分解定理)
  9. System.IO.IsolatedStorage 使用 IsolatedStorageFileStream 存储信息
  10. 别了WindowsXP