Flutter Engine
 
Loading...
Searching...
No Matches
command_buffer.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_LIB_GPU_COMMAND_BUFFER_H_
6#define FLUTTER_LIB_GPU_COMMAND_BUFFER_H_
7
13
14namespace flutter {
15namespace gpu {
16
17class CommandBuffer : public RefCountedDartWrappable<CommandBuffer> {
18 DEFINE_WRAPPERTYPEINFO();
20
21 public:
22 CommandBuffer(std::shared_ptr<impeller::Context> context,
23 std::shared_ptr<impeller::CommandBuffer> command_buffer);
24
25 std::shared_ptr<impeller::CommandBuffer> GetCommandBuffer();
26
27 void AddRenderPass(std::shared_ptr<impeller::RenderPass> render_pass);
28
29 bool Submit();
30 bool Submit(
31 const impeller::CommandBuffer::CompletionCallback& completion_callback);
32
33 ~CommandBuffer() override;
34
35 private:
36 std::shared_ptr<impeller::Context> context_;
37 std::shared_ptr<impeller::CommandBuffer> command_buffer_;
38 std::vector<std::shared_ptr<impeller::RenderPass>> encodables_;
39
41};
42
43} // namespace gpu
44} // namespace flutter
45
46//----------------------------------------------------------------------------
47/// Exports
48///
49
50extern "C" {
51
54 Dart_Handle wrapper,
55 flutter::gpu::Context* contextWrapper);
56
60 Dart_Handle completion_callback);
61
62} // extern "C"
63
64#endif // FLUTTER_LIB_GPU_COMMAND_BUFFER_H_
std::shared_ptr< impeller::CommandBuffer > GetCommandBuffer()
void AddRenderPass(std::shared_ptr< impeller::RenderPass > render_pass)
std::function< void(Status)> CompletionCallback
#define FML_DISALLOW_COPY_AND_ASSIGN(TypeName)
Definition macros.h:27
#define FLUTTER_GPU_EXPORT
Definition export.h:13
FLUTTER_GPU_EXPORT bool InternalFlutterGpu_CommandBuffer_Initialize(Dart_Handle wrapper, flutter::gpu::Context *contextWrapper)
FLUTTER_GPU_EXPORT Dart_Handle InternalFlutterGpu_CommandBuffer_Submit(flutter::gpu::CommandBuffer *wrapper, Dart_Handle completion_callback)
#define FML_FRIEND_MAKE_REF_COUNTED(T)