Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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/gpu/ganesh/GrTypesPriv.h
"
16
#include "
src/gpu/ganesh/GrGpuBuffer.h
"
17
#include "
src/gpu/ganesh/GrRenderTask.h
"
18
#include "
src/gpu/ganesh/GrSurfaceProxy.h
"
19
20
#include <cstddef>
21
#include <utility>
22
23
class
GrOpFlushState
;
24
class
GrRecordingContext
;
25
class
GrResourceAllocator
;
26
27
class
GrTransferFromRenderTask
final :
public
GrRenderTask
{
28
public
:
29
GrTransferFromRenderTask
(
sk_sp<GrSurfaceProxy>
srcProxy,
30
const
SkIRect
& srcRect,
31
GrColorType
surfaceColorType,
32
GrColorType
dstColorType,
33
sk_sp<GrGpuBuffer>
dstBuffer,
34
size_t
dstOffset)
35
:
GrRenderTask
()
36
, fSrcProxy(
std
::move(srcProxy))
37
, fSrcRect(srcRect)
38
, fSurfaceColorType(surfaceColorType)
39
, fDstColorType(dstColorType)
40
, fDstBuffer(
std
::move(dstBuffer))
41
, fDstOffset(dstOffset) {}
42
43
private
:
44
bool
onIsUsed
(
GrSurfaceProxy
* proxy)
const override
{
45
SkASSERT
(0 == this->
numTargets
());
46
return
proxy == fSrcProxy.
get
();
47
}
48
void
gatherProxyIntervals
(
GrResourceAllocator
*)
const override
;
49
50
ExpectedOutcome
onMakeClosed
(
GrRecordingContext
*,
SkIRect
*)
override
{
51
return
ExpectedOutcome::kTargetUnchanged
;
52
}
53
54
bool
onExecute
(
GrOpFlushState
*)
override
;
55
56
#if defined(GR_TEST_UTILS)
57
const
char
*
name
() const final {
return
"TransferFrom"
; }
58
#endif
59
#ifdef SK_DEBUG
60
void
visitProxies_debugOnly(
const
GrVisitProxyFunc
& func)
const override
{
61
func(fSrcProxy.
get
(), skgpu::Mipmapped::kNo);
62
}
63
#endif
64
65
sk_sp<GrSurfaceProxy>
fSrcProxy;
66
SkIRect
fSrcRect;
67
GrColorType
fSurfaceColorType;
68
GrColorType
fDstColorType;
69
sk_sp<GrGpuBuffer>
fDstBuffer;
70
size_t
fDstOffset;
71
72
};
73
74
#endif
75
GpuTypes.h
GrGpuBuffer.h
GrRenderTask.h
GrSurfaceProxy.h
GrTypesPriv.h
GrVisitProxyFunc
std::function< void(GrSurfaceProxy *, skgpu::Mipmapped)> GrVisitProxyFunc
Definition
GrTypesPriv.h:942
GrColorType
GrColorType
Definition
GrTypesPriv.h:539
SkAssert.h
SkASSERT
#define SkASSERT(cond)
Definition
SkAssert.h:116
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:27
GrTransferFromRenderTask::onIsUsed
bool onIsUsed(GrSurfaceProxy *proxy) const override
Definition
GrTransferFromRenderTask.h:44
GrTransferFromRenderTask::GrTransferFromRenderTask
GrTransferFromRenderTask(sk_sp< GrSurfaceProxy > srcProxy, const SkIRect &srcRect, GrColorType surfaceColorType, GrColorType dstColorType, sk_sp< GrGpuBuffer > dstBuffer, size_t dstOffset)
Definition
GrTransferFromRenderTask.h:29
GrTransferFromRenderTask::onMakeClosed
ExpectedOutcome onMakeClosed(GrRecordingContext *, SkIRect *) override
Definition
GrTransferFromRenderTask.h:50
GrTransferFromRenderTask::gatherProxyIntervals
void gatherProxyIntervals(GrResourceAllocator *) const override
Definition
GrTransferFromRenderTask.cpp:14
GrTransferFromRenderTask::onExecute
bool onExecute(GrOpFlushState *) override
Definition
GrTransferFromRenderTask.cpp:24
sk_sp
Definition
SkRefCnt.h:220
sk_sp::get
T * get() const
Definition
SkRefCnt.h:303
name
const char * name
Definition
fuchsia.cc:50
std
Definition
ref_ptr.h:256
SkIRect
Definition
SkRect.h:32
Generated on Fri Apr 26 2024 06:17:06 for Flutter Engine by
1.9.8