Flutter Engine
The Flutter Engine
third_party
skia
src
gpu
ganesh
GrTransferFromRenderTask.h
Go to the documentation of this file.
1
/*
2
* Copyright 2019 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 GrTransferFromRenderTask_DEFINED
9
#define GrTransferFromRenderTask_DEFINED
10
11
#include "
include/core/SkRect.h
"
12
#include "
include/core/SkRefCnt.h
"
13
#include "
include/gpu/GpuTypes.h
"
14
#include "
include/private/base/SkAssert.h
"
15
#include "
include/private/base/SkDebug.h
"
16
#include "
include/private/gpu/ganesh/GrTypesPriv.h
"
17
#include "
src/gpu/ganesh/GrGpuBuffer.h
"
18
#include "
src/gpu/ganesh/GrRenderTask.h
"
19
#include "
src/gpu/ganesh/GrSurfaceProxy.h
"
20
21
#include <cstddef>
22
#include <utility>
23
24
class
GrOpFlushState
;
25
class
GrRecordingContext
;
26
class
GrResourceAllocator
;
27
28
class
GrTransferFromRenderTask
final :
public
GrRenderTask
{
29
public
:
30
GrTransferFromRenderTask
(
sk_sp<GrSurfaceProxy>
srcProxy,
31
const
SkIRect
& srcRect,
32
GrColorType
surfaceColorType,
33
GrColorType
dstColorType,
34
sk_sp<GrGpuBuffer>
dstBuffer,
35
size_t
dstOffset)
36
:
GrRenderTask
()
37
, fSrcProxy(
std
::move(srcProxy))
38
, fSrcRect(srcRect)
39
, fSurfaceColorType(surfaceColorType)
40
, fDstColorType(dstColorType)
41
, fDstBuffer(
std
::move(dstBuffer))
42
, fDstOffset(dstOffset) {}
43
44
private
:
45
bool
onIsUsed(
GrSurfaceProxy
* proxy)
const override
{
46
SkASSERT
(0 == this->
numTargets
());
47
return
proxy == fSrcProxy.
get
();
48
}
49
void
gatherProxyIntervals(
GrResourceAllocator
*)
const override
;
50
51
ExpectedOutcome
onMakeClosed(
GrRecordingContext
*,
SkIRect
*)
override
{
52
return
ExpectedOutcome::kTargetUnchanged
;
53
}
54
55
bool
onExecute(
GrOpFlushState
*)
override
;
56
57
#if defined(GR_TEST_UTILS)
58
const
char
*
name
() const final {
return
"TransferFrom"
; }
59
#endif
60
#ifdef SK_DEBUG
61
void
visitProxies_debugOnly(
const
GrVisitProxyFunc
& func)
const override
{
62
func(fSrcProxy.
get
(),
skgpu::Mipmapped::kNo
);
63
}
64
#endif
65
66
sk_sp<GrSurfaceProxy>
fSrcProxy;
67
SkIRect
fSrcRect;
68
GrColorType
fSurfaceColorType;
69
GrColorType
fDstColorType;
70
sk_sp<GrGpuBuffer>
fDstBuffer;
71
size_t
fDstOffset;
72
73
};
74
75
#endif
76
GpuTypes.h
GrGpuBuffer.h
GrRenderTask.h
GrSurfaceProxy.h
GrTypesPriv.h
GrVisitProxyFunc
std::function< void(GrSurfaceProxy *, skgpu::Mipmapped)> GrVisitProxyFunc
Definition:
GrTypesPriv.h:943
GrColorType
GrColorType
Definition:
GrTypesPriv.h:540
SkAssert.h
SkASSERT
#define SkASSERT(cond)
Definition:
SkAssert.h:116
SkDebug.h
SkRect.h
SkRefCnt.h
GrOpFlushState
Definition:
GrOpFlushState.h:58
GrRecordingContext
Definition:
GrRecordingContext.h:42
GrRenderTask
Definition:
GrRenderTask.h:31
GrRenderTask::numTargets
int numTargets() const
Definition:
GrRenderTask.h:103
GrRenderTask::ExpectedOutcome
ExpectedOutcome
Definition:
GrRenderTask.h:170
GrRenderTask::ExpectedOutcome::kTargetUnchanged
@ kTargetUnchanged
GrResourceAllocator
Definition:
GrResourceAllocator.h:78
GrSurfaceProxy
Definition:
GrSurfaceProxy.h:49
GrTransferFromRenderTask
Definition:
GrTransferFromRenderTask.h:28
GrTransferFromRenderTask::GrTransferFromRenderTask
GrTransferFromRenderTask(sk_sp< GrSurfaceProxy > srcProxy, const SkIRect &srcRect, GrColorType surfaceColorType, GrColorType dstColorType, sk_sp< GrGpuBuffer > dstBuffer, size_t dstOffset)
Definition:
GrTransferFromRenderTask.h:30
sk_sp< GrSurfaceProxy >
sk_sp::get
T * get() const
Definition:
SkRefCnt.h:303
flutter::name
DEF_SWITCHES_START aot vmservice shared library name
Definition:
switches.h:32
skgpu::Mipmapped::kNo
@ kNo
std
Definition:
ref_ptr.h:256
SkIRect
Definition:
SkRect.h:32
Generated on Sun Jun 23 2024 21:56:21 for Flutter Engine by
1.9.4