• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2021 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_GpuWorkSubmission_DEFINED
9 #define skgpu_graphite_GpuWorkSubmission_DEFINED
10 
11 #include "include/core/SkRefCnt.h"
12 
13 #include <memory>
14 
15 namespace skgpu::graphite {
16 class CommandBuffer;
17 class SharedContext;
18 class QueueManager;
19 
20 class GpuWorkSubmission {
21 public:
22     virtual ~GpuWorkSubmission();
23 
24     virtual bool isFinished() = 0;
25     virtual void waitUntilFinished() = 0;
26 
27 protected:
commandBuffer()28     CommandBuffer* commandBuffer() { return fCommandBuffer.get(); }
29 
30     GpuWorkSubmission(std::unique_ptr<CommandBuffer> cmdBuffer, QueueManager* queueManager);
31 
32 private:
33     std::unique_ptr<CommandBuffer> fCommandBuffer;
34     QueueManager* fQueueManager;
35 };
36 
37 } // namespace skgpu::graphite
38 
39 #endif // skgpu_graphite_GpuWorkSubmission_DEFINED
40