blob: 969f368e3e25f27c133a28e995dc9b23bdd9a4fd [file] [log] [blame]
Chris Dalton3d770272019-08-14 09:24:37 -06001/*
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 GrTextureResolveRenderTask_DEFINED
9#define GrTextureResolveRenderTask_DEFINED
10
11#include "src/gpu/GrRenderTask.h"
12
13class GrTextureResolveRenderTask final : public GrRenderTask {
14public:
15 static sk_sp<GrRenderTask> Make(
16 sk_sp<GrTextureProxy>, GrTextureResolveFlags, const GrCaps&);
17
18private:
19 GrTextureResolveRenderTask(sk_sp<GrTextureProxy> textureProxy, GrTextureResolveFlags flags)
20 : GrRenderTask(std::move(textureProxy))
21 , fResolveFlags(flags) {
22 SkASSERT(GrTextureResolveFlags::kNone != fResolveFlags);
23 }
24
25 void onPrepare(GrOpFlushState*) override {}
26 bool onIsUsed(GrSurfaceProxy* proxy) const override {
27 SkASSERT(proxy != fTarget.get()); // This case should be handled by GrRenderTask.
28 return false;
29 }
30 void handleInternalAllocationFailure() override {}
31 void gatherProxyIntervals(GrResourceAllocator*) const override;
Chris Daltonaa3cbb82019-08-21 00:01:21 -060032
33 ExpectedOutcome onMakeClosed(const GrCaps&) override {
34 return ExpectedOutcome::kTargetUnchanged;
35 }
36
Chris Dalton3d770272019-08-14 09:24:37 -060037 bool onExecute(GrOpFlushState*) override;
38
Chris Daltonc4b47352019-08-23 10:10:36 -060039#ifdef SK_DEBUG
40 // No non-dst proxies.
41 void visitProxies_debugOnly(const GrOp::VisitProxyFunc& fn) const override {}
42#endif
43
Chris Dalton3d770272019-08-14 09:24:37 -060044 const GrTextureResolveFlags fResolveFlags;
45};
46
47#endif