Flutter Impeller
command_buffer_mtl.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 #pragma once
6 
7 #include <Metal/Metal.h>
8 
9 #include "flutter/fml/macros.h"
11 
12 namespace impeller {
13 
14 class CommandBufferMTL final : public CommandBuffer {
15  public:
16  // |CommandBuffer|
17  ~CommandBufferMTL() override;
18 
19  private:
20  friend class ContextMTL;
21 
22  id<MTLCommandBuffer> buffer_ = nullptr;
23 
24  CommandBufferMTL(const std::weak_ptr<const Context>& context,
25  id<MTLCommandQueue> queue);
26 
27  // |CommandBuffer|
28  void SetLabel(const std::string& label) const override;
29 
30  // |CommandBuffer|
31  bool IsValid() const override;
32 
33  // |CommandBuffer|
34  bool OnSubmitCommands(CompletionCallback callback) override;
35 
36  // |CommandBuffer|
37  void OnWaitUntilScheduled() override;
38 
39  // |CommandBuffer|
40  bool SubmitCommandsAsync(std::shared_ptr<RenderPass> render_pass) override;
41 
42  // |CommandBuffer|
43  std::shared_ptr<RenderPass> OnCreateRenderPass(RenderTarget target) override;
44 
45  // |CommandBuffer|
46  std::shared_ptr<BlitPass> OnCreateBlitPass() override;
47 
48  // |CommandBuffer|
49  std::shared_ptr<ComputePass> OnCreateComputePass() override;
50 
51  FML_DISALLOW_COPY_AND_ASSIGN(CommandBufferMTL);
52 };
53 
54 } // namespace impeller
impeller::CommandBuffer::CompletionCallback
std::function< void(Status)> CompletionCallback
Definition: command_buffer.h:54
impeller::CommandBufferMTL
Definition: command_buffer_mtl.h:14
impeller::RenderTarget
Definition: render_target.h:48
impeller::CommandBufferMTL::~CommandBufferMTL
~CommandBufferMTL() override
command_buffer.h
impeller::ContextMTL
Definition: context_mtl.h:32
impeller
Definition: aiks_context.cc:10
impeller::CommandBuffer
A collection of encoded commands to be submitted to the GPU for execution. A command buffer is obtain...
Definition: command_buffer.h:44