Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
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
10
#include "
flutter/flow/layers/container_layer.h
"
11
#include "
flutter/flow/layers/layer_raster_cache_item.h
"
12
#include "
flutter/flow/raster_cache_util.h
"
13
14
namespace
flutter
{
15
16
class
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
33
class
CacheableContainerLayer
:
public
ContainerLayer
{
34
public
:
35
explicit
CacheableContainerLayer
(
36
int
layer_cached_threshold =
37
RasterCacheUtil::kMinimumRendersBeforeCachingFilterLayer
,
38
bool
can_cache_children =
false
);
39
40
#if !SLIMPELLER
41
const
LayerRasterCacheItem
*
raster_cache_item
()
const
{
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_
flutter::AutoCache
Definition
cacheable_layer.h:16
flutter::AutoCache::ShouldNotBeCached
void ShouldNotBeCached()
Definition
cacheable_layer.h:22
flutter::AutoCache::~AutoCache
~AutoCache()
Definition
cacheable_layer.cc:30
flutter::CacheableContainerLayer
Definition
cacheable_layer.h:33
flutter::CacheableContainerLayer::raster_cache_item
const LayerRasterCacheItem * raster_cache_item() const
Definition
cacheable_layer.h:41
flutter::CacheableContainerLayer::layer_raster_cache_item_
std::unique_ptr< LayerRasterCacheItem > layer_raster_cache_item_
Definition
cacheable_layer.h:46
flutter::ContainerLayer
Definition
container_layer.h:14
flutter::LayerRasterCacheItem
Definition
layer_raster_cache_item.h:17
flutter::RasterCacheItem
Definition
raster_cache_item.h:27
container_layer.h
layer_raster_cache_item.h
flutter
Definition
asset_manager.cc:10
raster_cache_util.h
flutter::PrerollContext
Definition
layer.h:45
flutter::RasterCacheUtil::kMinimumRendersBeforeCachingFilterLayer
static constexpr int kMinimumRendersBeforeCachingFilterLayer
Definition
raster_cache_util.h:37
impeller::Matrix
A 4x4 matrix using column-major storage.
Definition
matrix.h:37
flow
layers
cacheable_layer.h
Generated on Tue Dec 2 2025 04:46:37 for Flutter Engine Uber Docs by
1.9.8