Flutter Engine
The Flutter Engine
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
9
13
14void 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(),
21 alloc->incOps();
22}
23
24bool 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}
bool transferPixelsFrom(GrSurface *surface, SkIRect rect, GrColorType surfaceColorType, GrColorType bufferColorType, sk_sp< GrGpuBuffer > transferBuffer, size_t offset)
Definition: GrGpu.cpp:592
void addInterval(GrSurfaceProxy *, unsigned int start, unsigned int end, ActualUse actualUse, AllowRecycling SkDEBUGCODE(, bool isDirectDstRead=false))
unsigned int curOp() const
GrSurface * peekSurface() const
bool isInstantiated() const
T * get() const
Definition: SkRefCnt.h:303