blob: 379aa4b34530776ba8e5ca01dd720c04149e3c05 [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 Daltone2a903e2019-09-18 13:41:50 -060024 void handleInternalAllocationFailure() override {
25 // No need to do anything special here. We just double check the proxies during onExecute.
26 }
Chris Dalton3d770272019-08-14 09:24:37 -060027 void gatherProxyIntervals(GrResourceAllocator*) const override;
Chris Daltonaa3cbb82019-08-21 00:01:21 -060028
Chris Dalton16a33c62019-09-24 22:19:17 -060029 ExpectedOutcome onMakeClosed(const GrCaps&, SkIRect*) override {
Chris Daltonaa3cbb82019-08-21 00:01:21 -060030 return ExpectedOutcome::kTargetUnchanged;
31 }
32
Chris Dalton3d770272019-08-14 09:24:37 -060033 bool onExecute(GrOpFlushState*) override;
34
Chris Daltonc4b47352019-08-23 10:10:36 -060035#ifdef SK_DEBUG
Robert Phillips44e2c5f2020-04-14 13:00:04 -040036 const char* name() const final { return "TextureResolve"; }
37 void visitProxies_debugOnly(const GrOp::VisitProxyFunc&) const override;
Chris Daltonc4b47352019-08-23 10:10:36 -060038#endif
39
Chris Daltone2a903e2019-09-18 13:41:50 -060040 struct Resolve {
Adlai Holler33d569e2020-06-16 14:30:08 -040041 Resolve(GrSurfaceProxy::ResolveFlags flags) : fFlags(flags) {}
Chris Daltone2a903e2019-09-18 13:41:50 -060042 GrSurfaceProxy::ResolveFlags fFlags;
Chris Dalton16a33c62019-09-24 22:19:17 -060043 SkIRect fMSAAResolveRect;
Chris Daltone2a903e2019-09-18 13:41:50 -060044 };
45
46 SkSTArray<4, Resolve> fResolves;
Chris Dalton3d770272019-08-14 09:24:37 -060047};
48
49#endif