Coverage Report

Created: 2021-08-22 09:07

/src/skia/src/gpu/GrWaitRenderTask.h
Line
Count
Source (jump to first uncovered line)
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
11
#include "src/gpu/GrRenderTask.h"
12
#include "src/gpu/GrSemaphore.h"
13
14
class GrWaitRenderTask final : public GrRenderTask {
15
public:
16
    GrWaitRenderTask(GrSurfaceProxyView surfaceView,
17
                     std::unique_ptr<std::unique_ptr<GrSemaphore>[]> semaphores,
18
                     int numSemaphores)
19
            : GrRenderTask()
20
            , fSemaphores(std::move(semaphores))
21
            , fNumSemaphores(numSemaphores)
22
0
            , fWaitedOn(std::move(surfaceView)) {}
23
24
private:
25
0
    bool onIsUsed(GrSurfaceProxy* proxy) const override {
26
0
        return proxy == fWaitedOn.proxy();
27
0
    }
28
    void gatherProxyIntervals(GrResourceAllocator*) const override;
29
30
0
    ExpectedOutcome onMakeClosed(GrRecordingContext*, SkIRect*) override {
31
0
        return ExpectedOutcome::kTargetUnchanged;
32
0
    }
33
34
    bool onExecute(GrOpFlushState*) override;
35
36
#if GR_TEST_UTILS
37
0
    const char* name() const final { return "Wait"; }
38
#endif
39
#ifdef SK_DEBUG
40
    // No non-dst proxies.
41
0
    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