Chris Dalton | 3d77027 | 2019-08-14 09:24:37 -0600 | [diff] [blame] | 1 | /* |
| 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 | |
| 13 | class GrTextureResolveRenderTask final : public GrRenderTask { |
| 14 | public: |
Greg Daniel | 16f5c65 | 2019-10-29 11:26:01 -0400 | [diff] [blame] | 15 | GrTextureResolveRenderTask() : GrRenderTask() {} |
Chris Dalton | 3d77027 | 2019-08-14 09:24:37 -0600 | [diff] [blame] | 16 | |
Adlai Holler | d71b7b0 | 2020-06-08 15:55:00 -0400 | [diff] [blame] | 17 | void addProxy(GrDrawingManager*, sk_sp<GrSurfaceProxy> proxy, |
| 18 | GrSurfaceProxy::ResolveFlags, const GrCaps&); |
Chris Dalton | 6aeb8e8 | 2019-08-27 11:52:19 -0600 | [diff] [blame] | 19 | |
| 20 | private: |
Chris Dalton | 3d77027 | 2019-08-14 09:24:37 -0600 | [diff] [blame] | 21 | bool onIsUsed(GrSurfaceProxy* proxy) const override { |
Chris Dalton | 3d77027 | 2019-08-14 09:24:37 -0600 | [diff] [blame] | 22 | return false; |
| 23 | } |
Chris Dalton | 3d77027 | 2019-08-14 09:24:37 -0600 | [diff] [blame] | 24 | void gatherProxyIntervals(GrResourceAllocator*) const override; |
Chris Dalton | aa3cbb8 | 2019-08-21 00:01:21 -0600 | [diff] [blame] | 25 | |
Chris Dalton | aa938ce | 2021-06-23 18:13:59 -0600 | [diff] [blame^] | 26 | ExpectedOutcome onMakeClosed(GrRecordingContext*, SkIRect*) override { |
Chris Dalton | aa3cbb8 | 2019-08-21 00:01:21 -0600 | [diff] [blame] | 27 | return ExpectedOutcome::kTargetUnchanged; |
| 28 | } |
| 29 | |
Chris Dalton | 3d77027 | 2019-08-14 09:24:37 -0600 | [diff] [blame] | 30 | bool onExecute(GrOpFlushState*) override; |
| 31 | |
John Stiles | 1e0136e | 2020-08-12 18:44:00 -0400 | [diff] [blame] | 32 | #if GR_TEST_UTILS |
Robert Phillips | 44e2c5f | 2020-04-14 13:00:04 -0400 | [diff] [blame] | 33 | const char* name() const final { return "TextureResolve"; } |
John Stiles | 1e0136e | 2020-08-12 18:44:00 -0400 | [diff] [blame] | 34 | #endif |
| 35 | #ifdef SK_DEBUG |
Robert Phillips | 294723d | 2021-06-17 09:23:58 -0400 | [diff] [blame] | 36 | void visitProxies_debugOnly(const GrVisitProxyFunc&) const override; |
Chris Dalton | c4b4735 | 2019-08-23 10:10:36 -0600 | [diff] [blame] | 37 | #endif |
| 38 | |
Chris Dalton | e2a903e | 2019-09-18 13:41:50 -0600 | [diff] [blame] | 39 | struct Resolve { |
Adlai Holler | 33d569e | 2020-06-16 14:30:08 -0400 | [diff] [blame] | 40 | Resolve(GrSurfaceProxy::ResolveFlags flags) : fFlags(flags) {} |
Chris Dalton | e2a903e | 2019-09-18 13:41:50 -0600 | [diff] [blame] | 41 | GrSurfaceProxy::ResolveFlags fFlags; |
Chris Dalton | 16a33c6 | 2019-09-24 22:19:17 -0600 | [diff] [blame] | 42 | SkIRect fMSAAResolveRect; |
Chris Dalton | e2a903e | 2019-09-18 13:41:50 -0600 | [diff] [blame] | 43 | }; |
| 44 | |
| 45 | SkSTArray<4, Resolve> fResolves; |
Chris Dalton | 3d77027 | 2019-08-14 09:24:37 -0600 | [diff] [blame] | 46 | }; |
| 47 | |
| 48 | #endif |