阅读 104

八、composite 流程分析

一、Flutter 之图像绘制原理

二、Widget、Element、RenderObject

三、Flutter UI 更新流程

四、build 流程分析

五、layout 流程分析

六、Paint 绘制(1)

七、Paint 绘制(2)

九、Flutter 小实践

(1) drawFrame

void drawFrame() {
  
  pipelineOwner.flushLayout();
  pipelineOwner.flushCompositingBits();
  pipelineOwner.flushPaint();
  renderView.compositeFrame(); // this sends the bits to the GPU
}
复制代码

(2) compositeFrame

void compositeFrame() {
    final ui.SceneBuilder builder = ui.SceneBuilder();
    final ui.Scene scene = layer.buildScene(builder);
    if (automaticSystemUiAdjustment)
      _updateSystemChrome();
    _window.render(scene);
    scene.dispose();
}
复制代码

Composited Layer就是把所有layer组合成Scene,然后通过 ui.window.render 方法,把 scene提交给Engine,到这一步,Framework向Engine提交数据基本完成了