blob: c0da50a781b48a4e1f3b29d67b34015fe97496d2 [file] [log] [blame]
Chris Dalton08755122019-08-05 16:13:47 -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 GrTextureResolveManager_DEFINED
9#define GrTextureResolveManager_DEFINED
10
11#include "include/core/SkRefCnt.h"
Chris Dalton3d770272019-08-14 09:24:37 -060012#include "src/gpu/GrDrawingManager.h"
Chris Dalton08755122019-08-05 16:13:47 -060013
14class GrCaps;
15class GrDrawingManager;
16class GrRenderTask;
17class 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 */
24class GrTextureResolveManager {
25public:
26 explicit GrTextureResolveManager(GrDrawingManager* drawingManager)
27 : fDrawingManager(drawingManager) {}
28
Chris Dalton08755122019-08-05 16:13:47 -060029 GrRenderTask* newTextureResolveRenderTask(
Chris Dalton3d770272019-08-14 09:24:37 -060030 sk_sp<GrTextureProxy> proxy, GrTextureResolveFlags flags, const GrCaps& caps) const {
31 SkASSERT(fDrawingManager);
32 return fDrawingManager->newTextureResolveRenderTask(std::move(proxy), flags, caps);
33 }
Chris Dalton08755122019-08-05 16:13:47 -060034
35private:
36 GrDrawingManager* fDrawingManager;
37};
38
Chris Dalton08755122019-08-05 16:13:47 -060039#endif