blob: 4c1d8487991c511c308425f12cd32cbf5057945f [file] [log] [blame]
* Copyright 2019 Google LLC
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
#include "src/gpu/GrTransferFromRenderTask.h"
#include "src/gpu/GrGpu.h"
#include "src/gpu/GrOpFlushState.h"
#include "src/gpu/GrResourceAllocator.h"
void GrTransferFromRenderTask::gatherProxyIntervals(GrResourceAllocator* alloc) const {
// This renderTask doesn't have "normal" ops. In this case we still need to add an interval (so
// fEndOfOpsTaskOpIndices will remain in sync), so we create a fake op# to capture the fact that
// we read fSrcProxy.
alloc->addInterval(fSrcProxy.get(), alloc->curOp(), alloc->curOp(),
bool GrTransferFromRenderTask::onExecute(GrOpFlushState* flushState) {
if (!fSrcProxy->isInstantiated()) {
return false;
return flushState->gpu()->transferPixelsFrom(
fSrcProxy->peekSurface(), fSrcRect.fLeft, fSrcRect.fTop, fSrcRect.width(),
fSrcRect.height(), fSurfaceColorType, fDstColorType, fDstBuffer, fDstOffset);