blob: eadcdca7f86f2bf6ee09bd63cda175bacafc0ec5 [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:
15 static sk_sp<GrRenderTask> Make(
16 sk_sp<GrTextureProxy>, GrTextureResolveFlags, const GrCaps&);
17
18private:
19 GrTextureResolveRenderTask(sk_sp<GrTextureProxy> textureProxy, GrTextureResolveFlags flags)
20 : GrRenderTask(std::move(textureProxy))
21 , fResolveFlags(flags) {
22 SkASSERT(GrTextureResolveFlags::kNone != fResolveFlags);
23 }
24
25 void onPrepare(GrOpFlushState*) override {}
26 bool onIsUsed(GrSurfaceProxy* proxy) const override {
27 SkASSERT(proxy != fTarget.get()); // This case should be handled by GrRenderTask.
28 return false;
29 }
30 void handleInternalAllocationFailure() override {}
31 void gatherProxyIntervals(GrResourceAllocator*) const override;
32 bool onExecute(GrOpFlushState*) override;
33
34 const GrTextureResolveFlags fResolveFlags;
35};
36
37#endif