blob: 00afd85df1fbff398f177b2a087821b5adac8af1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
/*
* Copyright 2017 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkDeferredDisplayList_DEFINED
#define SkDeferredDisplayList_DEFINED
#include "SkSurfaceCharacterization.h"
#if SK_SUPPORT_GPU
#include <map>
#include "GrCCPerOpListPaths.h"
#include "GrOpList.h"
#endif
class SkSurface;
/*
* This class contains pre-processed gpu operations that can be replayed into
* an SkSurface via draw(SkDeferredDisplayList*).
*
* TODO: we probably need to expose this class so users can query it for memory usage.
*/
class SK_API SkDeferredDisplayList {
public:
#if SK_SUPPORT_GPU
// This object is the source from which the lazy proxy backing the DDL will pull its backing
// texture when the DDL is replayed. It has to be separately ref counted bc the lazy proxy
// can outlive the DDL.
class LazyProxyData : public SkRefCnt {
public:
// Upon being replayed - this field will be filled in (by the DrawingManager) with the proxy
// backing the destination SkSurface. Note that, since there is no good place to clear it
// it can become a dangling pointer.
GrRenderTargetProxy* fReplayDest = nullptr;
};
#else
class LazyProxyData : public SkRefCnt {};
#endif
SkDeferredDisplayList(const SkSurfaceCharacterization& characterization,
sk_sp<LazyProxyData>);
~SkDeferredDisplayList();
const SkSurfaceCharacterization& characterization() const {
return fCharacterization;
}
private:
friend class GrDrawingManager; // for access to 'fOpLists' and 'fLazyProxyData'
friend class SkDeferredDisplayListRecorder; // for access to 'fLazyProxyData'
const SkSurfaceCharacterization fCharacterization;
#if SK_SUPPORT_GPU
// This needs to match the same type in GrCoverageCountingPathRenderer.h
using PendingPathsMap = std::map<uint32_t, sk_sp<GrCCPerOpListPaths>>;
SkTArray<sk_sp<GrOpList>> fOpLists;
PendingPathsMap fPendingPaths; // This is the path data from CCPR.
#endif
sk_sp<LazyProxyData> fLazyProxyData;
};
#endif
|