生成 layer和property 的算法
https://chromium.googlesource.com/chromium/src/+/HEAD/third_party/blink/renderer/platform/graphics/compositing/README.md
Source/platform/graphics/compositing
This directory contains the implementation of the “Blink compositing algorithm”.
This code is owned by the [paint team][paint-team-site]. [paint-team-site]: https://www.chromium.org/teams/paint-team
This document explains the CAP world as it develops, not the SPv1 world it replaces.
Blink compositing algorithm
Design document: goo.gl/6xP8Oe
Inputs: PaintArtifact
Outputs: List of cc::Layer
objects and cc::PropertyTree
's.
The algorithm walks through the list of PaintChunks
in the PaintArtifact
, allocating new cc::Layers
if the PaintChunk
cannot merge into an existing cc::Layer
. The reasons why it would not be able to do so are:
-
The
PaintChunk
requires a foreign layer (see below) -
The
PaintChunk
cannot merge with any existing layer, due incompatible direct compositing reasons on itsPropertyTreeState
. -
The
PaintChunk
overlaps with an earliercc::Layer
that it can't merge with due to reason 2, and there is no later-drawncc::Layer
for which reasons 1 and 2 do not apply.
In the worst case, this algorithm has an O(n^2) running time, where n is the number of PaintChunks
.
All property tree nodes referred to by any PaintChunk
are currently copied into their equivalent cc::PropertyTree
node, regardless of whether they are required by the above.
Flattening property tree nodes
When PaintChunks
can merge into an existing cc::Layer
, they may have different PropertyTreeState
s than the PropertyTreeState
of the cc::Layer
. If so, we need to flatten down the nodes that are different between the PropertyTreeState
of the PaintChunk
and the cc::Layer
. This is done by emitting paired display items to adjust the PaintChunk
s property tree state to the current state when the PaintChunk
is consumed. See: ConversionContext::Convert
.
Foreign layers
Some PaintChunk
content requires a foreign layer, meaning a layer that is managed outside of the scope of this code. Examples are composited video, a and 2D/3D (WebGL) canvas.
Raster invalidations
Any raster invalidates on a PaintChunk
are also mapped to the space of the backing cc::Layer
.
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)
2020-12-16 ubuntu虚拟机下 虚拟摄像头 模拟摄像头 virtualCam
2014-12-16 Android在初始化时弹出popwindow的方法
2014-12-16 关于 Java 对象序列化您不知道的 5 件事
2013-12-16 Announcing WebKit SDL port