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 #include "src/gpu/graphite/GpuWorkSubmission.h" 9 10 #include "src/gpu/graphite/CommandBuffer.h" 11 #include "src/gpu/graphite/QueueManager.h" 12 13 namespace skgpu::graphite { 14 GpuWorkSubmission(std::unique_ptr<CommandBuffer> cmdBuffer,QueueManager * queueManager)15GpuWorkSubmission::GpuWorkSubmission(std::unique_ptr<CommandBuffer> cmdBuffer, 16 QueueManager* queueManager) 17 : fCommandBuffer(std::move(cmdBuffer)) 18 , fQueueManager(queueManager) {} 19 ~GpuWorkSubmission()20GpuWorkSubmission::~GpuWorkSubmission() { 21 fCommandBuffer->callFinishedProcs(/*success=*/true); 22 fCommandBuffer->resetCommandBuffer(); 23 fQueueManager->returnCommandBuffer(std::move(fCommandBuffer)); 24 } 25 26 } // namespace skgpu::graphite 27 28