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