* 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/ganesh/GrWaitRenderTask.h"
#include "include/private/base/SkAssert.h"
#include "src/gpu/ganesh/GrGpu.h"
#include "src/gpu/ganesh/GrOpFlushState.h"
#include "src/gpu/ganesh/GrResourceAllocator.h"
void GrWaitRenderTask::gatherProxyIntervals(GrResourceAllocator* alloc) const {
SkASSERT(0 == this->numTargets());
auto fakeOp = alloc->curOp();
alloc->addInterval(fWaitedOn.proxy(), fakeOp, fakeOp,
GrResourceAllocator::ActualUse::kYes,
GrResourceAllocator::AllowRecycling::kYes);
alloc->incOps();
}
bool GrWaitRenderTask::onExecute(GrOpFlushState* flushState) {
for (int i = 0; i < fNumSemaphores; ++i) {
if (fSemaphores[i]) {
flushState->gpu()->waitSemaphore(fSemaphores[i].get());
}
}
return true;
}