Flutter Engine
The Flutter Engine
CopyTask.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_task_CopyTask_DEFINED
9#define skgpu_graphite_task_CopyTask_DEFINED
10
12
13#include "include/core/SkRect.h"
14
15namespace skgpu::graphite {
16
17class Buffer;
18class Texture;
19class TextureProxy;
20
21class CopyBufferToBufferTask final : public Task {
22public:
23 // The srcBuffer for this Task is always a transfer buffer which is owned by the
24 // UploadBufferManager. Thus we don't have to take a ref to it as the UploadBufferManager will
25 // handle its refs and passing them to the Recording.
26 static sk_sp<CopyBufferToBufferTask> Make(const Buffer* srcBuffer,
27 size_t srcOffset,
28 sk_sp<Buffer> dstBuffer,
29 size_t dstOffset,
30 size_t size);
31
33
36 const RuntimeEffectDictionary*) override;
37
39
40private:
41 CopyBufferToBufferTask(const Buffer* srcBuffer,
42 size_t srcOffset,
43 sk_sp<Buffer> dstBuffer,
44 size_t dstOffset,
45 size_t size);
46
47 const Buffer* fSrcBuffer;
48 size_t fSrcOffset;
49 sk_sp<Buffer> fDstBuffer;
50 size_t fDstOffset;
51 size_t fSize;
52};
53
54class CopyTextureToBufferTask final : public Task {
55public:
57 SkIRect srcRect,
59 size_t bufferOffset,
60 size_t bufferRowBytes);
61
62 ~CopyTextureToBufferTask() override;
63
66 const RuntimeEffectDictionary*) override;
67
69
70private:
72 SkIRect srcRect,
74 size_t bufferOffset,
75 size_t bufferRowBytes);
76
77 sk_sp<TextureProxy> fTextureProxy;
78 SkIRect fSrcRect;
79 sk_sp<Buffer> fBuffer;
80 size_t fBufferOffset;
81 size_t fBufferRowBytes;
82};
83
84class CopyTextureToTextureTask final : public Task {
85public:
87 SkIRect srcRect,
88 sk_sp<TextureProxy> dstProxy,
89 SkIPoint dstPoint,
90 int dstLevel = 0);
91
93
96 const RuntimeEffectDictionary*) override;
97
99
100private:
102 SkIRect srcRect,
103 sk_sp<TextureProxy> dstProxy,
104 SkIPoint dstPoint,
105 int dstLevel);
106
107 sk_sp<TextureProxy> fSrcProxy;
108 SkIRect fSrcRect;
109 sk_sp<TextureProxy> fDstProxy;
110 SkIPoint fDstPoint;
111 int fDstLevel;
112};
113
114} // namespace skgpu::graphite
115
116#endif // skgpu_graphite_task_CopyTask_DEFINED
Status prepareResources(ResourceProvider *, ScratchResourceManager *, const RuntimeEffectDictionary *) override
Definition: CopyTask.cpp:47
static sk_sp< CopyBufferToBufferTask > Make(const Buffer *srcBuffer, size_t srcOffset, sk_sp< Buffer > dstBuffer, size_t dstOffset, size_t size)
Definition: CopyTask.cpp:18
Status addCommands(Context *, CommandBuffer *, ReplayTargetData) override
Definition: CopyTask.cpp:53
static sk_sp< CopyTextureToBufferTask > Make(sk_sp< TextureProxy >, SkIRect srcRect, sk_sp< Buffer >, size_t bufferOffset, size_t bufferRowBytes)
Definition: CopyTask.cpp:63
Status addCommands(Context *, CommandBuffer *, ReplayTargetData) override
Definition: CopyTask.cpp:105
Status prepareResources(ResourceProvider *, ScratchResourceManager *, const RuntimeEffectDictionary *) override
Definition: CopyTask.cpp:92
Status addCommands(Context *, CommandBuffer *, ReplayTargetData) override
Definition: CopyTask.cpp:180
static sk_sp< CopyTextureToTextureTask > Make(sk_sp< TextureProxy > srcProxy, SkIRect srcRect, sk_sp< TextureProxy > dstProxy, SkIPoint dstPoint, int dstLevel=0)
Definition: CopyTask.cpp:123
Status prepareResources(ResourceProvider *, ScratchResourceManager *, const RuntimeEffectDictionary *) override
Definition: CopyTask.cpp:151
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition: switches.h:259
Definition: SkRect.h:32