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/ganesh/GrRenderTask.h" 12 13 class GrTextureResolveRenderTask final : public GrRenderTask { 14 public: GrTextureResolveRenderTask()15 GrTextureResolveRenderTask() : GrRenderTask() {} 16 17 void addProxy(GrDrawingManager*, sk_sp<GrSurfaceProxy> proxy, 18 GrSurfaceProxy::ResolveFlags, const GrCaps&); 19 #if GR_TEST_UTILS 20 GrSurfaceProxy::ResolveFlags flagsForProxy(sk_sp<GrSurfaceProxy>) const; 21 #endif 22 23 private: onIsUsed(GrSurfaceProxy * proxy)24 bool onIsUsed(GrSurfaceProxy* proxy) const override { 25 return false; 26 } 27 void gatherProxyIntervals(GrResourceAllocator*) const override; 28 onMakeClosed(GrRecordingContext *,SkIRect *)29 ExpectedOutcome onMakeClosed(GrRecordingContext*, SkIRect*) override { 30 return ExpectedOutcome::kTargetUnchanged; 31 } 32 33 bool onExecute(GrOpFlushState*) override; 34 35 #if GR_TEST_UTILS name()36 const char* name() const final { return "TextureResolve"; } 37 #endif 38 #ifdef SK_DEBUG 39 void visitProxies_debugOnly(const GrVisitProxyFunc&) const override; 40 #endif 41 42 struct Resolve { ResolveResolve43 Resolve(GrSurfaceProxy::ResolveFlags flags) : fFlags(flags) {} 44 GrSurfaceProxy::ResolveFlags fFlags; 45 SkIRect fMSAAResolveRect; 46 }; 47 48 SkSTArray<4, Resolve> fResolves; 49 }; 50 51 #endif 52