mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Tell the raster cache when checkerboarding preferences have been updated. (flutter/engine#3205)
This commit is contained in:
parent
d0de04bfa7
commit
b09b35cc06
@ -13,7 +13,7 @@ LayerTree::LayerTree()
|
||||
: frame_size_{},
|
||||
scene_version_(0),
|
||||
rasterizer_tracing_threshold_(0),
|
||||
checkerboard_raster_cache_images_(0) {}
|
||||
checkerboard_raster_cache_images_(false) {}
|
||||
|
||||
LayerTree::~LayerTree() {}
|
||||
|
||||
@ -21,6 +21,8 @@ void LayerTree::Raster(CompositorContext::ScopedFrame& frame,
|
||||
bool ignore_raster_cache) {
|
||||
{
|
||||
TRACE_EVENT0("flutter", "LayerTree::Preroll");
|
||||
frame.context().raster_cache().SetCheckboardCacheImages(
|
||||
checkerboard_raster_cache_images_);
|
||||
Layer::PrerollContext context = {
|
||||
ignore_raster_cache ? nullptr : &frame.context().raster_cache(),
|
||||
frame.gr_context(), SkRect::MakeEmpty(),
|
||||
|
||||
@ -70,10 +70,6 @@ class LayerTree {
|
||||
checkerboard_raster_cache_images_ = checkerboard;
|
||||
}
|
||||
|
||||
bool checkerboard_raster_cache_images() const {
|
||||
return checkerboard_raster_cache_images_;
|
||||
}
|
||||
|
||||
private:
|
||||
SkISize frame_size_; // Physical pixels.
|
||||
uint32_t scene_version_;
|
||||
|
||||
@ -156,11 +156,7 @@ void RasterCache::SetCheckboardCacheImages(bool checkerboard) {
|
||||
|
||||
// Clear all existing entries so previously rasterized items (with or without
|
||||
// a checkerboard) will be refreshed in subsequent passes.
|
||||
blink::Threads::Gpu()->PostTask([self = weak_factory_.GetWeakPtr()]() {
|
||||
if (self) {
|
||||
self->Clear();
|
||||
}
|
||||
});
|
||||
Clear();
|
||||
}
|
||||
|
||||
} // namespace flow
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user