Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
flow
raster_cache_key.cc
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
#include "flutter/flow/raster_cache_key.h"
6
#include <optional>
7
#include "flutter/flow/layers/container_layer.h"
8
#include "flutter/flow/layers/display_list_layer.h"
9
#include "flutter/flow/layers/layer.h"
10
namespace
flutter
{
11
12
//
13
14
std::optional<std::vector<RasterCacheKeyID>>
RasterCacheKeyID::LayerChildrenIds
(
15
const
Layer
* layer) {
16
FML_DCHECK
(layer->
as_container_layer
());
17
auto
& children_layers = layer->
as_container_layer
()->
layers
();
18
auto
children_count = children_layers.size();
19
if
(children_count == 0) {
20
return
std::nullopt;
21
}
22
std::vector<RasterCacheKeyID> ids;
23
std::transform(
24
children_layers.begin(), children_layers.end(), std::back_inserter(ids),
25
[](
auto
& layer) ->
RasterCacheKeyID
{ return layer->caching_key_id(); });
26
return
ids;
27
}
28
29
}
// namespace flutter
flutter::ContainerLayer::layers
const std::vector< std::shared_ptr< Layer > > & layers() const
Definition
container_layer.h:26
flutter::Layer
Definition
layer.h:126
flutter::Layer::as_container_layer
virtual const ContainerLayer * as_container_layer() const
Definition
layer.h:255
flutter::RasterCacheKeyID
Definition
raster_cache_key.h:23
flutter::RasterCacheKeyID::LayerChildrenIds
static std::optional< std::vector< RasterCacheKeyID > > LayerChildrenIds(const Layer *layer)
Definition
raster_cache_key.cc:14
FML_DCHECK
#define FML_DCHECK(condition)
Definition
logging.h:103
flutter
Definition
asset_manager.cc:10
Generated on Fri Apr 26 2024 06:14:04 for Flutter Engine by
1.9.8