-
Notifications
You must be signed in to change notification settings - Fork 6k
Defer decisions about RasterCache actions until after Preroll is complete #31892
Changes from 1 commit
9f44aad
bb6a4cc
51ae333
bb86e3a
98b4ad6
2a0fbc3
9a71e09
0f60777
d53733e
4600cd6
7626d11
d88aff2
45b28cf
57a8d16
e4eb2a0
7e5af26
879ee10
2c038e9
829e9f4
91cf4e9
ba5694e
45448d4
dc089ad
2f1eb2f
473288b
a80a037
fd82489
d3883c6
3e1ed6c
a25e920
fd3bc8e
cdc123d
d8d373a
9e0e52b
9b68847
7c7fc4c
91f7278
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
…layer
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,7 +9,6 @@ | |
| #include "flutter/flow/layer_snapshot_store.h" | ||
| #include "flutter/flow/layers/cacheable_layer.h" | ||
| #include "flutter/flow/layers/layer.h" | ||
| #include "flutter/flow/raster_cache.h" | ||
| #include "flutter/fml/time/time_point.h" | ||
| #include "flutter/fml/trace_event.h" | ||
| #include "include/core/SkMatrix.h" | ||
|
|
@@ -66,38 +65,36 @@ bool LayerTree::Preroll(CompositorContext::ScopedFrame& frame, | |
|
|
||
| root_layer_->Preroll(&context, frame.root_surface_transformation()); | ||
|
|
||
| RasterCache(frame, &context); | ||
| TryToRasterCache(&context); | ||
|
|
||
| return context.surface_needs_readback; | ||
| } | ||
|
|
||
| void LayerTree::RasterCache(CompositorContext::ScopedFrame& frame, | ||
| PrerollContext* context, | ||
| bool ignore_raster_cache) { | ||
| auto* color_space = GetColorSpace(frame.canvas()); | ||
| auto* raster_cache = | ||
| ignore_raster_cache ? nullptr : &frame.context().raster_cache(); | ||
| void LayerTree::TryToRasterCache(PrerollContext* context, | ||
| bool ignore_raster_cache) { | ||
| auto mutator_stack = MutatorsStack(); | ||
| for (unsigned i = 0; i < context->raster_cached_entries.size(); i++) { | ||
| auto& entry = context->raster_cached_entries[i]; | ||
| if (entry->need_caching) { | ||
| PrerollContext context = { | ||
| raster_cache, | ||
| frame.gr_context(), | ||
| frame.view_embedder(), | ||
| mutator_stack, | ||
| color_space, | ||
| entry->cull_rect, | ||
| false, | ||
| frame.context().raster_time(), | ||
| frame.context().ui_time(), | ||
| frame.context().texture_registry(), | ||
| checkerboard_offscreen_layers_, | ||
| device_pixel_ratio_, | ||
| entry->has_platform_view, | ||
| entry->has_texture_layer, | ||
| PrerollContext preroll_context = { | ||
| // clang-format off | ||
| .raster_cache = context->raster_cache, | ||
| .gr_context = context->gr_context, | ||
| .view_embedder = context->view_embedder, | ||
| .mutators_stack = mutator_stack, | ||
| .dst_color_space = context->dst_color_space, | ||
| .cull_rect = entry->cull_rect, | ||
| .surface_needs_readback = false, | ||
| .raster_time = context->raster_time, | ||
| .ui_time = context->ui_time, | ||
| .texture_registry = context->texture_registry, | ||
| .checkerboard_offscreen_layers = context->checkerboard_offscreen_layers, | ||
| .frame_device_pixel_ratio = context->frame_device_pixel_ratio, | ||
| .has_platform_view = entry->has_platform_view, | ||
| .has_texture_layer = entry->has_texture_layer, | ||
| // clang-format on | ||
| }; | ||
| entry->TryToPrepareRasterCache(&context); | ||
| entry->TryToPrepareRasterCache(&preroll_context); | ||
|
||
| i += entry->num_child_entries; | ||
| } | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.