| 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/task/SynchronizeToCpuTask.h" |
| 9 |
|
| 10 |
#include "src/gpu/graphite/Buffer.h" |
| 11 |
#include "src/gpu/graphite/CommandBuffer.h" |
| 12 |
|
| 13 |
namespace skgpu::graphite { |
| 14 |
|
| 15 |
sk_sp<SynchronizeToCpuTask> SynchronizeToCpuTask::Make(sk_sp<Buffer> buffer) { |
| 16 |
return sk_sp<SynchronizeToCpuTask>(new SynchronizeToCpuTask(std::move(buffer))); |
| 17 |
} |
| 18 |
|
| 19 |
SynchronizeToCpuTask::~SynchronizeToCpuTask() {} |
| 20 |
|
| 21 |
Task::Status SynchronizeToCpuTask::addCommands(Context*, |
| 22 |
CommandBuffer* commandBuffer, |
| 23 |
ReplayTargetData) { |
| 24 |
return commandBuffer->synchronizeBufferToCpu(std::move(fBuffer)) ? Status::kSuccess |
| 25 |
: Status::kFail; |
| 26 |
} |
| 27 |
|
| 28 |
} // namespace skgpu::graphite |