Flutter Engine
The Flutter Engine
GpuWorkSubmission.h
Go to the documentation of this file.
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
12
13#include <memory>
14
15namespace skgpu::graphite {
16class CommandBuffer;
17class SharedContext;
18class QueueManager;
19
21public:
22 virtual ~GpuWorkSubmission();
23
24 bool isFinished(const SharedContext* sharedContext);
25 void waitUntilFinished(const SharedContext* sharedContext);
26
27protected:
28 CommandBuffer* commandBuffer() { return fCommandBuffer.get(); }
29
30 GpuWorkSubmission(std::unique_ptr<CommandBuffer> cmdBuffer, QueueManager* queueManager);
31
32private:
33 virtual bool onIsFinished(const SharedContext* sharedContext) = 0;
34 virtual void onWaitUntilFinished(const SharedContext* sharedContext) = 0;
35
36 std::unique_ptr<CommandBuffer> fCommandBuffer;
37 sk_sp<SkRefCnt> fOutstandingAsyncMapCounter;
38 QueueManager* fQueueManager;
39};
40
41} // namespace skgpu::graphite
42
43#endif // skgpu_graphite_GpuWorkSubmission_DEFINED
void waitUntilFinished(const SharedContext *sharedContext)
virtual void onWaitUntilFinished(const SharedContext *sharedContext)=0
virtual bool onIsFinished(const SharedContext *sharedContext)=0
GpuWorkSubmission(std::unique_ptr< CommandBuffer > cmdBuffer, QueueManager *queueManager)
bool isFinished(const SharedContext *sharedContext)