Flutter Engine
The Flutter Engine
GrCopyRenderTask.h
Go to the documentation of this file.
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 GrCopyRenderTask_DEFINED
9#define GrCopyRenderTask_DEFINED
10
13
14class GrCopyRenderTask final : public GrRenderTask {
15public:
16 /**
17 * Copies pixels from srcRect in src to dstRect in dst. srcRect and dstRect must both be
18 * contained in their respective surface dimensions; they do not have to have the same size
19 * if the GPU supports scaling and filtering while copying. The src/dst share a common origin.
20 */
23 SkIRect dstRect,
25 SkIRect srcRect,
28
29private:
32 SkIRect dstRect,
34 SkIRect srcRect,
37
38 void onMakeSkippable() override { fSrc.reset(); }
39 bool onIsUsed(GrSurfaceProxy* proxy) const override { return proxy == fSrc.get(); }
40 void gatherProxyIntervals(GrResourceAllocator*) const override;
41 ExpectedOutcome onMakeClosed(GrRecordingContext*, SkIRect* targetUpdateBounds) override;
42 bool onExecute(GrOpFlushState*) override;
43
44#if defined(GR_TEST_UTILS)
45 const char* name() const final { return "Copy"; }
46#endif
47#ifdef SK_DEBUG
48 void visitProxies_debugOnly(const GrVisitProxyFunc& func) const override {
49 func(fSrc.get(), skgpu::Mipmapped::kNo);
50 }
51#endif
52
54 SkIRect fSrcRect;
55 SkIRect fDstRect;
57 GrSurfaceOrigin fOrigin;
58};
59
60#endif
61
std::function< void(GrSurfaceProxy *, skgpu::Mipmapped)> GrVisitProxyFunc
Definition: GrTypesPriv.h:943
GrSurfaceOrigin
Definition: GrTypes.h:147
SkFilterMode
static sk_sp< GrRenderTask > Make(GrDrawingManager *, sk_sp< GrSurfaceProxy > dst, SkIRect dstRect, sk_sp< GrSurfaceProxy > src, SkIRect srcRect, GrSamplerState::Filter filter, GrSurfaceOrigin)
T * get() const
Definition: SkRefCnt.h:303
void reset(T *ptr=nullptr)
Definition: SkRefCnt.h:310
DEF_SWITCHES_START aot vmservice shared library name
Definition: switches.h:32
dst
Definition: cp.py:12
Definition: SkRect.h:32