blob: 64a39544376c111125e19a2e52edd22d44d199ee [file] [log] [blame]
Brian Salomonbe1084b2021-01-26 13:29:30 -05001/*
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
13class GrWritePixelsTask final : public GrRenderTask {
14public:
15 static sk_sp<GrRenderTask> Make(GrDrawingManager*,
16 sk_sp<GrSurfaceProxy>,
17 SkIRect,
18 GrColorType srcColorType,
19 GrColorType dstColorType,
20 const GrMipLevel[],
Brian Salomon75ee7372021-04-06 15:04:35 -040021 int levelCount);
Brian Salomonbe1084b2021-01-26 13:29:30 -050022
23private:
24 GrWritePixelsTask(GrDrawingManager*,
25 sk_sp<GrSurfaceProxy> dst,
26 SkIRect,
27 GrColorType srcColorType,
28 GrColorType dstColorType,
29 const GrMipLevel[],
Brian Salomon75ee7372021-04-06 15:04:35 -040030 int levelCount);
Brian Salomonbe1084b2021-01-26 13:29:30 -050031
32 bool onIsUsed(GrSurfaceProxy* proxy) const override { return false; }
Brian Salomonbe1084b2021-01-26 13:29:30 -050033 void gatherProxyIntervals(GrResourceAllocator*) const override;
Chris Daltonaa938ce2021-06-23 18:13:59 -060034 ExpectedOutcome onMakeClosed(GrRecordingContext*, SkIRect* targetUpdateBounds) override;
Brian Salomonbe1084b2021-01-26 13:29:30 -050035 bool onExecute(GrOpFlushState*) override;
36
37#if GR_TEST_UTILS
38 const char* name() const final { return "WritePixels"; }
39#endif
40#ifdef SK_DEBUG
Robert Phillips294723d2021-06-17 09:23:58 -040041 void visitProxies_debugOnly(const GrVisitProxyFunc&) const override {}
Brian Salomonbe1084b2021-01-26 13:29:30 -050042#endif
43
Brian Salomon2c673402021-04-02 14:36:58 -040044 SkAutoSTArray<16, GrMipLevel> fLevels;
Brian Salomonbe1084b2021-01-26 13:29:30 -050045 SkIRect fRect;
46 GrColorType fSrcColorType;
47 GrColorType fDstColorType;
Brian Salomonbe1084b2021-01-26 13:29:30 -050048};
49
50#endif
51