Debian Codegraph @

src/gpu/graphite/mtl/MtlQueueManager.h

raw
1 /*
2 * Copyright 2022 Google LLC
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #ifndef skgpu_graphite_MtlQueueManager_DEFINED
9 #define skgpu_graphite_MtlQueueManager_DEFINED
10
11 #include "include/ports/SkCFObject.h"
12 #include "src/gpu/graphite/QueueManager.h"
13
14 #import <Metal/Metal.h>
15
16 namespace skgpu::graphite {
17
18 class MtlSharedContext;
19
20 class MtlQueueManager : public QueueManager {
21 public:
22 MtlQueueManager(sk_cfp<id<MTLCommandQueue>> queue, const SharedContext*);
23 ~MtlQueueManager() override {}
24
25 private:
26 const MtlSharedContext* mtlSharedContext() const;
27
28 std::unique_ptr<CommandBuffer> getNewCommandBuffer(ResourceProvider*, Protected) override;
29 OutstandingSubmission onSubmitToGpu(const SubmitInfo&) override;
30
31 #if defined(GPU_TEST_UTILS)
32 void startCapture() override;
33 void stopCapture() override;
34 #endif
35
36 sk_cfp<id<MTLCommandQueue>> fQueue;
37 };
38
39 } // namespace skgpu::graphite
40
41 #endif // skgpu_graphite_MtlQueueManager_DEFINED