2 * Copyright 2019 Google LLC
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
8 #include "src/gpu/ganesh/GrWaitRenderTask.h"
10 #include "src/gpu/ganesh/GrGpu.h"
11 #include "src/gpu/ganesh/GrOpFlushState.h"
12 #include "src/gpu/ganesh/GrResourceAllocator.h"
14 void GrWaitRenderTask::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 manipulate our target's proxy.
18 SkASSERT(0 == this->numTargets());
19 auto fakeOp = alloc->curOp();
20 alloc->addInterval(fWaitedOn.proxy(), fakeOp, fakeOp,
21 GrResourceAllocator::ActualUse::kYes);
25 bool GrWaitRenderTask::onExecute(GrOpFlushState* flushState) {
26 for (int i = 0; i < fNumSemaphores; ++i) {
27 // If we don't have a semaphore here it means we failed to wrap it. That happens if the
28 // client didn't give us a valid semaphore to begin with. Therefore, it is fine to not wait
31 flushState->gpu()->waitSemaphore(fSemaphores[i].get());