1 /* 2 * Copyright 2021 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 GrWritePixelsTask_DEFINED 9 #define GrWritePixelsTask_DEFINED 10 11 #include "src/gpu/GrRenderTask.h" 12 13 class GrWritePixelsTask final : public GrRenderTask { 14 public: 15 static sk_sp<GrRenderTask> Make(GrDrawingManager*, 16 sk_sp<GrSurfaceProxy>, 17 SkIRect, 18 GrColorType srcColorType, 19 GrColorType dstColorType, 20 const GrMipLevel[], 21 int levelCount); 22 23 private: 24 GrWritePixelsTask(GrDrawingManager*, 25 sk_sp<GrSurfaceProxy> dst, 26 SkIRect, 27 GrColorType srcColorType, 28 GrColorType dstColorType, 29 const GrMipLevel[], 30 int levelCount); 31 onIsUsed(GrSurfaceProxy * proxy)32 bool onIsUsed(GrSurfaceProxy* proxy) const override { return false; } 33 void gatherProxyIntervals(GrResourceAllocator*) const override; 34 ExpectedOutcome onMakeClosed(const GrCaps&, SkIRect* targetUpdateBounds) override; 35 bool onExecute(GrOpFlushState*) override; 36 37 #if GR_TEST_UTILS name()38 const char* name() const final { return "WritePixels"; } 39 #endif 40 #ifdef SK_DEBUG visitProxies_debugOnly(const GrOp::VisitProxyFunc & fn)41 void visitProxies_debugOnly(const GrOp::VisitProxyFunc& fn) const override {} 42 #endif 43 44 SkAutoSTArray<16, GrMipLevel> fLevels; 45 SkIRect fRect; 46 GrColorType fSrcColorType; 47 GrColorType fDstColorType; 48 }; 49 50 #endif 51 52