Flutter Engine
The Flutter Engine
pipeline_library.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
6
7namespace impeller {
8
10
12
14 std::optional<PipelineDescriptor> descriptor,
15 bool async) {
16 if (descriptor.has_value()) {
17 return GetPipeline(descriptor.value(), async);
18 }
19 auto promise = std::make_shared<
20 std::promise<std::shared_ptr<Pipeline<PipelineDescriptor>>>>();
21 promise->set_value(nullptr);
22 return {descriptor, promise->get_future()};
23}
24
26 std::optional<ComputePipelineDescriptor> descriptor,
27 bool async) {
28 if (descriptor.has_value()) {
29 return GetPipeline(descriptor.value(), async);
30 }
31 auto promise = std::make_shared<
32 std::promise<std::shared_ptr<Pipeline<ComputePipelineDescriptor>>>>();
33 promise->set_value(nullptr);
34 return {descriptor, promise->get_future()};
35}
36
37} // namespace impeller
PipelineFuture< PipelineDescriptor > GetPipeline(std::optional< PipelineDescriptor > descriptor, bool async=true)