| Flutter Impeller |

command_queue.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 "impeller/renderer/command_queue.h"
6 #include "impeller/renderer/command_buffer.h"
7
8 namespace impeller {
9
10 CommandQueue::CommandQueue() = default;
11
12 CommandQueue::~CommandQueue() = default;
13
14 fml::Status CommandQueue::Submit(
15 const std::vector<std::shared_ptr<CommandBuffer>>& buffers,
16 const CompletionCallback& completion_callback,
17 bool block_on_schedule) {
18 if (buffers.empty()) {
19 if (completion_callback) {
20 completion_callback(CommandBuffer::Status::kError);
21 }
22 return fml::Status(fml::StatusCode::kInvalidArgument,
23 "No command buffers provided.");
24 }
25 for (const std::shared_ptr<CommandBuffer>& buffer : buffers) {
26 if (!buffer->SubmitCommands(block_on_schedule, completion_callback)) {
27 return fml::Status(fml::StatusCode::kCancelled,
28 "Failed to submit command buffer.");
29 }
30 }
31 return fml::Status();
32 }
33
34 } // namespace impeller
impeller::CommandBuffer::Status::kError
@ kError
impeller::CommandQueue::CompletionCallback
std::function< void(CommandBuffer::Status)> CompletionCallback
Definition: command_queue.h:19
impeller::CommandQueue::CommandQueue
CommandQueue()
impeller::CommandQueue::Submit
virtual fml::Status Submit(const std::vector< std::shared_ptr< CommandBuffer >> &buffers, const CompletionCallback &completion_callback={}, bool block_on_schedule=false)
Submit one or more command buffer objects to be encoded and executed on the GPU.
Definition: command_queue.cc:14
impeller::CommandQueue::~CommandQueue
virtual ~CommandQueue()
command_buffer.h
command_queue.h
impeller
Definition: allocation.cc:12