Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
SynchronizeToCpuTask.h
Go to the documentation of this file.
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_task_SynchronizeToCpuTask_DEFINED
9#define skgpu_graphite_task_SynchronizeToCpuTask_DEFINED
10
13
14namespace skgpu::graphite {
15
16class Buffer;
17
18/**
19 * Task that synchronizes the contents of a buffer from the GPU to the CPU. This task ensures that
20 * all modifications to the buffer made the GPU are visible from the CPU. This task may not result
21 * in any work if the underlying buffer does not require synchronization (e.g. a shared memory
22 * buffer).
23 */
24class SynchronizeToCpuTask final : public Task {
25public:
27 ~SynchronizeToCpuTask() override;
28
30 return Status::kSuccess;
31 }
32
33 Status addCommands(Context*, CommandBuffer*, ReplayTargetData) override;
34
35private:
36 explicit SynchronizeToCpuTask(sk_sp<Buffer> buffer) : fBuffer(std::move(buffer)) {}
37
38 sk_sp<Buffer> fBuffer;
39};
40
41} // namespace skgpu::graphite
42
43#endif // skgpu_graphite_SynchronizeToCpuTask_DEFINED
static sk_sp< SynchronizeToCpuTask > Make(sk_sp< Buffer >)
Status addCommands(Context *, CommandBuffer *, ReplayTargetData) override
Status prepareResources(ResourceProvider *, const RuntimeEffectDictionary *) override
static const uint8_t buffer[]
Definition ref_ptr.h:256