@@ -230,34 +230,26 @@ class Rasterizer final : public SnapshotDelegate {
230230 flutter::TextureRegistry* GetTextureRegistry ();
231231
232232 // ----------------------------------------------------------------------------
233- // / @brief Takes the next item from the layer tree pipeline and executes
234- // / the raster thread frame workload for that pipeline item to
235- // / render a frame on the on-screen surface.
233+ // / @brief Takes the latest item from the layer tree holder and executes
234+ // / the raster thread frame workload for that item to render a
235+ // / frame on the on-screen surface.
236236 // /
237- // / Why does the draw call take a layer tree pipeline and not the
237+ // / Why does the draw call take a layer tree holder and not the
238238 // / layer tree directly?
239239 // /
240- // / The pipeline is the way book-keeping of frame workloads
241- // / distributed across the multiple threads is managed. The
242- // / rasterizer deals with the pipelines directly (instead of layer
243- // / trees which is what it actually renders) because the pipeline
244- // / consumer's workload must be accounted for within the pipeline
245- // / itself. If the rasterizer took the layer tree directly, it
246- // / would have to be taken out of the pipeline. That would signal
247- // / the end of the frame workload and the pipeline would be ready
248- // / for new frames. But the last frame has not been rendered by
249- // / the frame yet! On the other hand, the pipeline must own the
250- // / layer tree it renders because it keeps a reference to the last
251- // / layer tree around till a new frame is rendered. So a simple
252- // / reference wont work either. The `Rasterizer::DoDraw` method
253- // / actually performs the GPU operations within the layer tree
254- // / pipeline.
240+ // / The layer tree holder is a thread safe way to produce frame
241+ // / workloads from the UI thread and raster them on the raster
242+ // / thread. To account for scenarious where the UI thread
243+ // / continues to produce the frames while a raster task is queued,
244+ // / `Rasterizer::DoDraw` that gets executed on the raster thread,
245+ // / must pick up the newest layer tree produced by the UI thread.
246+ // / If we were to pass the layer tree as opposed to the holder, it
247+ // / would result in stale frames being rendered.
255248 // /
256249 // / @see `Rasterizer::DoDraw`
257250 // /
258- // / @param[in] pipeline The layer tree pipeline to take the next layer tree
259- // / to render from.
260- // / TODO(kaushikiska) fix docs whereever pipeline is mentioned.
251+ // / @param[in] layer_tree_holder The layer tree holder to take the latest
252+ // / layer tree to render from.
261253 void Draw (std::shared_ptr<LayerTreeHolder> layer_tree_holder);
262254
263255 // ----------------------------------------------------------------------------
@@ -425,7 +417,8 @@ class Rasterizer final : public SnapshotDelegate {
425417 std::unique_ptr<flutter::LayerTree> last_layer_tree_;
426418 // Set when we need attempt to rasterize the layer tree again. This layer_tree
427419 // has not successfully rasterized. This can happen due to the change in the
428- // thread configuration. This will be inserted to the front of the pipeline.
420+ // thread configuration. This layer tree could be rasterized again if there
421+ // are no newer ones.
429422 std::unique_ptr<flutter::LayerTree> resubmitted_layer_tree_;
430423 fml::closure next_frame_callback_;
431424 bool user_override_resource_cache_bytes_;
0 commit comments