blob: d3c95d678f808075b863bce649cb09841509db8c [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:
Chris Dalton3d770272019-08-14 09:24:37 -060015 GrTextureResolveRenderTask(sk_sp<GrTextureProxy> textureProxy, GrTextureResolveFlags flags)
16 : GrRenderTask(std::move(textureProxy))
17 , fResolveFlags(flags) {
18 SkASSERT(GrTextureResolveFlags::kNone != fResolveFlags);
19 }
20
Chris Dalton6aeb8e82019-08-27 11:52:19 -060021 void init(const GrCaps&);
22
23private:
Chris Dalton3d770272019-08-14 09:24:37 -060024 void onPrepare(GrOpFlushState*) override {}
25 bool onIsUsed(GrSurfaceProxy* proxy) const override {
26 SkASSERT(proxy != fTarget.get()); // This case should be handled by GrRenderTask.
27 return false;
28 }
29 void handleInternalAllocationFailure() override {}
30 void gatherProxyIntervals(GrResourceAllocator*) const override;
Chris Daltonaa3cbb82019-08-21 00:01:21 -060031
32 ExpectedOutcome onMakeClosed(const GrCaps&) override {
33 return ExpectedOutcome::kTargetUnchanged;
34 }
35
Chris Dalton3d770272019-08-14 09:24:37 -060036 bool onExecute(GrOpFlushState*) override;
37
Chris Daltonc4b47352019-08-23 10:10:36 -060038#ifdef SK_DEBUG
39 // No non-dst proxies.
40 void visitProxies_debugOnly(const GrOp::VisitProxyFunc& fn) const override {}
41#endif
42
Chris Dalton3d770272019-08-14 09:24:37 -060043 const GrTextureResolveFlags fResolveFlags;
44};
45
46#endif