Chris Dalton | 0875512 | 2019-08-05 16:13:47 -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 GrTextureResolveManager_DEFINED |
| 9 | #define GrTextureResolveManager_DEFINED |
| 10 | |
| 11 | #include "include/core/SkRefCnt.h" |
Chris Dalton | 3d77027 | 2019-08-14 09:24:37 -0600 | [diff] [blame^] | 12 | #include "src/gpu/GrDrawingManager.h" |
Chris Dalton | 0875512 | 2019-08-05 16:13:47 -0600 | [diff] [blame] | 13 | |
| 14 | class GrCaps; |
| 15 | class GrDrawingManager; |
| 16 | class GrRenderTask; |
| 17 | class GrTextureProxy; |
| 18 | |
| 19 | /* |
| 20 | * This class is a shallow view of the drawing manager. It is passed to render tasks when setting up |
| 21 | * the dependency DAG, and gives them limited access to functionality for making new tasks that |
| 22 | * regenerate mipmaps and/or resolve MSAA. |
| 23 | */ |
| 24 | class GrTextureResolveManager { |
| 25 | public: |
| 26 | explicit GrTextureResolveManager(GrDrawingManager* drawingManager) |
| 27 | : fDrawingManager(drawingManager) {} |
| 28 | |
Chris Dalton | 0875512 | 2019-08-05 16:13:47 -0600 | [diff] [blame] | 29 | GrRenderTask* newTextureResolveRenderTask( |
Chris Dalton | 3d77027 | 2019-08-14 09:24:37 -0600 | [diff] [blame^] | 30 | sk_sp<GrTextureProxy> proxy, GrTextureResolveFlags flags, const GrCaps& caps) const { |
| 31 | SkASSERT(fDrawingManager); |
| 32 | return fDrawingManager->newTextureResolveRenderTask(std::move(proxy), flags, caps); |
| 33 | } |
Chris Dalton | 0875512 | 2019-08-05 16:13:47 -0600 | [diff] [blame] | 34 | |
| 35 | private: |
| 36 | GrDrawingManager* fDrawingManager; |
| 37 | }; |
| 38 | |
Chris Dalton | 0875512 | 2019-08-05 16:13:47 -0600 | [diff] [blame] | 39 | #endif |