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