Flutter Engine
 
Loading...
Searching...
No Matches
cacheable_layer.h
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef FLUTTER_FLOW_LAYERS_CACHEABLE_LAYER_H_
6#define FLUTTER_FLOW_LAYERS_CACHEABLE_LAYER_H_
7
8#include <memory>
9
13
14namespace flutter {
15
16class AutoCache {
17 public:
18 AutoCache(RasterCacheItem* raster_cache_item,
19 PrerollContext* context,
20 const DlMatrix& matrix);
21
22 void ShouldNotBeCached() { raster_cache_item_ = nullptr; }
23
24 ~AutoCache();
25
26 private:
27 inline bool IsCacheEnabled();
28 RasterCacheItem* raster_cache_item_ = nullptr;
29 [[maybe_unused]] PrerollContext* context_ = nullptr;
30 const DlMatrix matrix_;
31};
32
34 public:
36 int layer_cached_threshold =
38 bool can_cache_children = false);
39
40#if !SLIMPELLER
42 return layer_raster_cache_item_.get();
43 }
44
45 protected:
46 std::unique_ptr<LayerRasterCacheItem> layer_raster_cache_item_;
47#endif // !SLIMPELLER
48};
49
50} // namespace flutter
51
52#endif // FLUTTER_FLOW_LAYERS_CACHEABLE_LAYER_H_
const LayerRasterCacheItem * raster_cache_item() const
std::unique_ptr< LayerRasterCacheItem > layer_raster_cache_item_
static constexpr int kMinimumRendersBeforeCachingFilterLayer
A 4x4 matrix using column-major storage.
Definition matrix.h:37