Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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
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
GrSurfaceProxy * proxy() const
ExpectedOutcome onMakeClosed(GrRecordingContext *, SkIRect *) override
bool onExecute(GrOpFlushState *) override
GrWaitRenderTask(GrSurfaceProxyView surfaceView, std::unique_ptr< std::unique_ptr< GrSemaphore >[]> semaphores, int numSemaphores)
void gatherProxyIntervals(GrResourceAllocator *) const override
bool onIsUsed(GrSurfaceProxy *proxy) const override
const char * name
Definition fuchsia.cc:50
Definition ref_ptr.h:256