Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
flow
layers
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
13
namespace
flutter
{
14
15
class
AutoCache
{
16
public
:
17
AutoCache
(
RasterCacheItem
* raster_cache_item,
18
PrerollContext
* context,
19
const
SkMatrix
& matrix);
20
21
void
ShouldNotBeCached
() { raster_cache_item_ =
nullptr
; }
22
23
~AutoCache
();
24
25
private
:
26
inline
bool
IsCacheEnabled();
27
RasterCacheItem
* raster_cache_item_ =
nullptr
;
28
PrerollContext
* context_ =
nullptr
;
29
const
SkMatrix
matrix_;
30
};
31
32
class
CacheableContainerLayer
:
public
ContainerLayer
{
33
public
:
34
explicit
CacheableContainerLayer
(
35
int
layer_cached_threshold =
36
RasterCacheUtil::kMinimumRendersBeforeCachingFilterLayer
,
37
bool
can_cache_children =
false
);
38
39
const
LayerRasterCacheItem
*
raster_cache_item
()
const
{
40
return
layer_raster_cache_item_
.get();
41
}
42
43
protected
:
44
std::unique_ptr<LayerRasterCacheItem>
layer_raster_cache_item_
;
45
};
46
47
}
// namespace flutter
48
49
#endif
// FLUTTER_FLOW_LAYERS_CACHEABLE_LAYER_H_
SkMatrix
Definition
SkMatrix.h:54
flutter::AutoCache
Definition
cacheable_layer.h:15
flutter::AutoCache::ShouldNotBeCached
void ShouldNotBeCached()
Definition
cacheable_layer.h:21
flutter::AutoCache::~AutoCache
~AutoCache()
Definition
cacheable_layer.cc:24
flutter::CacheableContainerLayer
Definition
cacheable_layer.h:32
flutter::CacheableContainerLayer::raster_cache_item
const LayerRasterCacheItem * raster_cache_item() const
Definition
cacheable_layer.h:39
flutter::CacheableContainerLayer::layer_raster_cache_item_
std::unique_ptr< LayerRasterCacheItem > layer_raster_cache_item_
Definition
cacheable_layer.h:44
flutter::ContainerLayer
Definition
container_layer.h:14
flutter::LayerRasterCacheItem
Definition
layer_raster_cache_item.h:15
flutter::RasterCacheItem
Definition
raster_cache_item.h:24
flutter
Definition
asset_manager.cc:10
flutter::PrerollContext
Definition
layer.h:54
flutter::RasterCacheUtil::kMinimumRendersBeforeCachingFilterLayer
static constexpr int kMinimumRendersBeforeCachingFilterLayer
Definition
raster_cache_util.h:36
Generated on Fri Apr 26 2024 06:14:03 for Flutter Engine by
1.9.8