blob: fc736e1c9b9f4d741ca54a65a5a2616cc6dce1a3 [file] [log] [blame]
Greg Danielc30f1a92019-09-06 15:28:58 -04001/*
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#ifndef GrWaitRenderTask_DEFINED
9#define GrWaitRenderTask_DEFINED
10
11#include "src/gpu/GrRenderTask.h"
12#include "src/gpu/GrSemaphore.h"
13
14class GrWaitRenderTask final : public GrRenderTask {
15public:
16 GrWaitRenderTask(sk_sp<GrSurfaceProxy> proxy, std::unique_ptr<sk_sp<GrSemaphore>[]> semaphores,
17 int numSemaphores)
18 : GrRenderTask(std::move(proxy))
19 , fSemaphores(std::move(semaphores))
20 , fNumSemaphores(numSemaphores){}
21
22private:
Greg Danielc30f1a92019-09-06 15:28:58 -040023 bool onIsUsed(GrSurfaceProxy* proxy) const override {
24 SkASSERT(proxy != fTarget.get()); // This case should be handled by GrRenderTask.
25 return false;
26 }
27 void handleInternalAllocationFailure() override {}
28 void gatherProxyIntervals(GrResourceAllocator*) const override;
29
Chris Dalton16a33c62019-09-24 22:19:17 -060030 ExpectedOutcome onMakeClosed(const GrCaps&, SkIRect*) override {
Greg Danielc30f1a92019-09-06 15:28:58 -040031 return ExpectedOutcome::kTargetUnchanged;
32 }
33
34 bool onExecute(GrOpFlushState*) override;
35
36#ifdef SK_DEBUG
37 // No non-dst proxies.
38 void visitProxies_debugOnly(const VisitSurfaceProxyFunc& fn) const override {}
39#endif
40 std::unique_ptr<sk_sp<GrSemaphore>[]> fSemaphores;
41 int fNumSemaphores;
42};
43
44#endif