Flutter Engine
The Flutter Engine
GrWaitRenderTask.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 GrWaitRenderTask_DEFINED
9#define GrWaitRenderTask_DEFINED
10
13
14class GrWaitRenderTask final : public GrRenderTask {
15public:
17 std::unique_ptr<std::unique_ptr<GrSemaphore>[]> semaphores,
18 int numSemaphores)
19 : GrRenderTask()
20 , fSemaphores(std::move(semaphores))
21 , fNumSemaphores(numSemaphores)
22 , fWaitedOn(std::move(surfaceView)) {}
23
24private:
25 bool onIsUsed(GrSurfaceProxy* proxy) const override {
26 return proxy == fWaitedOn.proxy();
27 }
28 void gatherProxyIntervals(GrResourceAllocator*) const override;
29
30 ExpectedOutcome onMakeClosed(GrRecordingContext*, SkIRect*) override {
32 }
33
34 bool onExecute(GrOpFlushState*) override;
35
36#if defined(GR_TEST_UTILS)
37 const char* name() const final { return "Wait"; }
38#endif
39#ifdef SK_DEBUG
40 // No non-dst proxies.
41 void visitProxies_debugOnly(const GrVisitProxyFunc&) const override {}
42#endif
43 std::unique_ptr<std::unique_ptr<GrSemaphore>[]> fSemaphores;
44 int fNumSemaphores;
45
46 // This field is separate from the main "targets" field on GrRenderTask because this task
47 // does not actually write to the surface and so should not participate in the normal
48 // lastRenderTask tracking that written-to targets do.
49 GrSurfaceProxyView fWaitedOn;
50};
51
52#endif
std::function< void(GrSurfaceProxy *, skgpu::Mipmapped)> GrVisitProxyFunc
Definition: GrTypesPriv.h:943
GrSurfaceProxy * proxy() const
GrWaitRenderTask(GrSurfaceProxyView surfaceView, std::unique_ptr< std::unique_ptr< GrSemaphore >[]> semaphores, int numSemaphores)
DEF_SWITCHES_START aot vmservice shared library name
Definition: switches.h:32
Definition: ref_ptr.h:256
Definition: SkRect.h:32