DisplayList的构建阶段
2022-08-02 18:10:20 0 举报
android的硬件绘制分为两部分,DisplayList的构建阶段和RenderThread的渲染阶段,此为前者的流程图
作者其他创作
大纲/内容
10 beginRecording
16.9 drawRenderNode
16.2 onDraw
16.8 nSetAnimationMatrix
结束记录DisplayList并返回
RenderNode
16.3 dispatchDraw
17.1 finishRecording
RecordingCanvasNative
25 syncAndDrawFrame
21 drawRenderNode
9 dispatchGetDisplayList
14/15步,作用是计算内容滚动量,切换坐标系到内容坐标系
将RenderNode树同步到render线程,请求进入渲染阶段
1 performTraversals
View DecorView
5 draw
ViewRootImpl
16.4 drawChild
RecordingCanvas
19 RecordingCanvas
if needed
18 beginRecording
6 updateRootDisplayList
13 返回RecordCanvas对象
ThreadedRenderer
8 updateDisplayListIfDirty
2 performDraw
16 dispatchDraw/draw
16.10 nDrawRenderNode
22 回调onPostDraw
12 返回RecordCanvas对象
RenderNodeNative
16.7 setAnimationMatrix
11 obtain
17 endRecording
4 invalidateRoot
20 回调onPreDraw
ThreadedRenderernative
View child
将DisplayList树写入Root RenderNode对应的RecordCanvas
3 draw
23 endRecording
7 updateViewTreeDisplayList
将DisplayList树写入Root RenderNode
16步,当控件自身不需要绘制时,调用dispatchDraw,绘制子控件;否则,调用draw。这里以draw为例
24 syncAndDraw
17.2返回DisplayList
Root RenderNode update
16.1 drawBackground
16.6 updateDisplayListIfDirty
0 条评论
下一页