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