Flutter Engine
The Flutter Engine
third_party
skia
src
gpu
ganesh
GrTransferFromRenderTask.cpp
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
#include "
src/gpu/ganesh/GrTransferFromRenderTask.h
"
9
10
#include "
src/gpu/ganesh/GrGpu.h
"
11
#include "
src/gpu/ganesh/GrOpFlushState.h
"
12
#include "
src/gpu/ganesh/GrResourceAllocator.h
"
13
14
void
GrTransferFromRenderTask::gatherProxyIntervals(
GrResourceAllocator
* alloc)
const
{
15
// This renderTask doesn't have "normal" ops. In this case we still need to add an interval (so
16
// fEndOfOpsTaskOpIndices will remain in sync), so we create a fake op# to capture the fact that
17
// we read fSrcProxy.
18
alloc->
addInterval
(fSrcProxy.
get
(), alloc->
curOp
(), alloc->
curOp
(),
19
GrResourceAllocator::ActualUse::kYes
,
20
GrResourceAllocator::AllowRecycling::kYes
);
21
alloc->
incOps
();
22
}
23
24
bool
GrTransferFromRenderTask::onExecute(
GrOpFlushState
* flushState) {
25
if
(!fSrcProxy->
isInstantiated
()) {
26
return
false
;
27
}
28
return
flushState->
gpu
()->
transferPixelsFrom
(fSrcProxy->
peekSurface
(),
29
fSrcRect,
30
fSurfaceColorType,
31
fDstColorType,
32
fDstBuffer,
33
fDstOffset);
34
}
GrGpu.h
GrOpFlushState.h
GrResourceAllocator.h
GrTransferFromRenderTask.h
GrGpu::transferPixelsFrom
bool transferPixelsFrom(GrSurface *surface, SkIRect rect, GrColorType surfaceColorType, GrColorType bufferColorType, sk_sp< GrGpuBuffer > transferBuffer, size_t offset)
Definition:
GrGpu.cpp:592
GrOpFlushState
Definition:
GrOpFlushState.h:58
GrOpFlushState::gpu
GrGpu * gpu()
Definition:
GrOpFlushState.h:85
GrResourceAllocator
Definition:
GrResourceAllocator.h:78
GrResourceAllocator::incOps
void incOps()
Definition:
GrResourceAllocator.h:86
GrResourceAllocator::addInterval
void addInterval(GrSurfaceProxy *, unsigned int start, unsigned int end, ActualUse actualUse, AllowRecycling SkDEBUGCODE(, bool isDirectDstRead=false))
Definition:
GrResourceAllocator.cpp:47
GrResourceAllocator::ActualUse::kYes
@ kYes
GrResourceAllocator::AllowRecycling::kYes
@ kYes
GrResourceAllocator::curOp
unsigned int curOp() const
Definition:
GrResourceAllocator.h:85
GrSurfaceProxy::peekSurface
GrSurface * peekSurface() const
Definition:
GrSurfaceProxy.h:269
GrSurfaceProxy::isInstantiated
bool isInstantiated() const
Definition:
GrSurfaceProxy.h:260
sk_sp::get
T * get() const
Definition:
SkRefCnt.h:303
Generated on Sun Jun 23 2024 21:56:21 for Flutter Engine by
1.9.4