blob: df2de81c3452f9287420635df8a80830590219c4 [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:
Greg Daniel16f5c652019-10-29 11:26:01 -040015 GrTextureResolveRenderTask() : GrRenderTask() {}
Chris Dalton3d770272019-08-14 09:24:37 -060016
Adlai Hollerd71b7b02020-06-08 15:55:00 -040017 void addProxy(GrDrawingManager*, sk_sp<GrSurfaceProxy> proxy,
18 GrSurfaceProxy::ResolveFlags, const GrCaps&);
Chris Dalton6aeb8e82019-08-27 11:52:19 -060019
20private:
Chris Dalton3d770272019-08-14 09:24:37 -060021 bool onIsUsed(GrSurfaceProxy* proxy) const override {
Chris Dalton3d770272019-08-14 09:24:37 -060022 return false;
23 }
Chris Dalton3d770272019-08-14 09:24:37 -060024 void gatherProxyIntervals(GrResourceAllocator*) const override;
Chris Daltonaa3cbb82019-08-21 00:01:21 -060025
Chris Daltonaa938ce2021-06-23 18:13:59 -060026 ExpectedOutcome onMakeClosed(GrRecordingContext*, SkIRect*) override {
Chris Daltonaa3cbb82019-08-21 00:01:21 -060027 return ExpectedOutcome::kTargetUnchanged;
28 }
29
Chris Dalton3d770272019-08-14 09:24:37 -060030 bool onExecute(GrOpFlushState*) override;
31
John Stiles1e0136e2020-08-12 18:44:00 -040032#if GR_TEST_UTILS
Robert Phillips44e2c5f2020-04-14 13:00:04 -040033 const char* name() const final { return "TextureResolve"; }
John Stiles1e0136e2020-08-12 18:44:00 -040034#endif
35#ifdef SK_DEBUG
Robert Phillips294723d2021-06-17 09:23:58 -040036 void visitProxies_debugOnly(const GrVisitProxyFunc&) const override;
Chris Daltonc4b47352019-08-23 10:10:36 -060037#endif
38
Chris Daltone2a903e2019-09-18 13:41:50 -060039 struct Resolve {
Adlai Holler33d569e2020-06-16 14:30:08 -040040 Resolve(GrSurfaceProxy::ResolveFlags flags) : fFlags(flags) {}
Chris Daltone2a903e2019-09-18 13:41:50 -060041 GrSurfaceProxy::ResolveFlags fFlags;
Chris Dalton16a33c62019-09-24 22:19:17 -060042 SkIRect fMSAAResolveRect;
Chris Daltone2a903e2019-09-18 13:41:50 -060043 };
44
45 SkSTArray<4, Resolve> fResolves;
Chris Dalton3d770272019-08-14 09:24:37 -060046};
47
48#endif