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