UI Framework-1: Aura Graphics Architecture
2024-10-01 15:28:37
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 WorldAt 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 FlowThroughout 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.
|
最新文章
- Storm中遇到的日志多次重写问题(一)
- php array 分页
- ASP.NET MVC铵钮Click后下载文件
- noi题库(noi.openjudge.cn) 1.8编程基础之多维数组T11——T20
- IOS-UITextField-全解
- Indoor Positioning System &; Real time location system
- 用word2013写博客
- 正确的 zip 压缩与解压代码
- rhel5.8 ISO yum源配置
- Linux命令-基本命令(1)
- HTML资源定位器-URL
- 计蒜客 无脑博士 bfs
- Redis扩展机制
- windows系统,boost编译安装
- 假如有Thread1、Thread2、Thread3、Thread4四条线程分别统计C、D、E、F四个盘的大小
- Flask、Celery、RabbitMQ学习计划
- C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\文件不断增长,如何处理?
- Mac-OSX下Ruby更新
- POJ-3273(二分)
- js&;jquery避免报错的方法
热门文章
- javaweb学习总结(六)——Servlet开发(三) 常见问题疑问
- org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files (x86)\Java\jdk1.7.0_7
- 转:IE 无法使用 js trim() 的解决方法
- hiho 1613 - 墨水滴 - bfs+优先队列 *
- 3ds Max 设置中文界面
- Matlab从入门到精通 Chapter5 数据可视化--
- c的面向对象思想记录
- 紫书 例题 10-4 UVa 10791(唯一分解定理)
- System.IO.IsolatedStorage 使用 IsolatedStorageFileStream 存储信息
- 别了WindowsXP