Coverage Report

Created: 2024-09-14 07:19

/src/skia/src/gpu/ganesh/GrDeferredDisplayListPriv.h
Line
Count
Source (jump to first uncovered line)
1
/*
2
 * Copyright 2023 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 GrDeferredDisplayListPriv_DEFINED
9
#define GrDeferredDisplayListPriv_DEFINED
10
11
#include "include/private/chromium/GrDeferredDisplayList.h"
12
13
/*************************************************************************************************/
14
/** Class that adds methods to GrDeferredDisplayList that are only intended for use internal to
15
    Skia. This class is purely a privileged window into GrDeferredDisplayList. It should never have
16
    additional data members or virtual methods. */
17
class GrDeferredDisplayListPriv {
18
public:
19
0
    int numRenderTasks() const {
20
0
        return fDDL->fRenderTasks.size();
21
0
    }
22
23
0
    GrRenderTargetProxy* targetProxy() const {
24
0
        return fDDL->fTargetProxy.get();
25
0
    }
26
27
0
    const GrDeferredDisplayList::LazyProxyData* lazyProxyData() const {
28
0
        return fDDL->fLazyProxyData.get();
29
0
    }
30
31
0
    const skia_private::TArray<GrRecordingContext::ProgramData>& programData() const {
32
0
        return fDDL->programData();
33
0
    }
34
35
0
    const skia_private::TArray<sk_sp<GrRenderTask>>& renderTasks() const {
36
0
        return fDDL->fRenderTasks;
37
0
    }
38
39
private:
40
0
    explicit GrDeferredDisplayListPriv(GrDeferredDisplayList* ddl) : fDDL(ddl) {}
41
    GrDeferredDisplayListPriv& operator=(const GrDeferredDisplayListPriv&) = delete;
42
43
    // No taking addresses of this type.
44
    const GrDeferredDisplayListPriv* operator&() const;
45
    GrDeferredDisplayListPriv* operator&();
46
47
    GrDeferredDisplayList* fDDL;
48
49
    friend class GrDeferredDisplayList; // to construct/copy this type.
50
};
51
52
0
inline GrDeferredDisplayListPriv GrDeferredDisplayList::priv() {
53
0
    return GrDeferredDisplayListPriv(this);
54
0
}
55
56
0
inline const GrDeferredDisplayListPriv GrDeferredDisplayList::priv () const {  // NOLINT(readability-const-return-type)
57
0
    return GrDeferredDisplayListPriv(const_cast<GrDeferredDisplayList*>(this));
58
0
}
59
60
#endif