This repository was archived by the owner on Feb 25, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +58
-3
lines changed Expand file tree Collapse file tree 4 files changed +58
-3
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,10 @@ This file includes a list of high level updates for each milestone release.
7
7
Milestone 82
8
8
9
9
<Insert new notes here- top is most recent.>
10
+ * Made SkDeferredDisplayList.h officially part of the public API (i.e., moved it to
11
+ include/core). Also added a ProgramIterator to SkDeferredDisplayList which allows
12
+ clients to pre-compile some of the shaders the DDL requires.
13
+
10
14
* Added two new helper methods to SkSurfaceCharacterization: createBackendFormat and
11
15
createFBO0. These make it easier for clients to create new surface characterizations that
12
16
differ only a little from an existing surface characterization.
Original file line number Diff line number Diff line change @@ -35,6 +35,26 @@ class SkDeferredDisplayList {
35
35
return fCharacterization ;
36
36
}
37
37
38
+ #if SK_SUPPORT_GPU
39
+ /* *
40
+ * Iterate through the programs required by the DDL.
41
+ */
42
+ class SK_API ProgramIterator {
43
+ public:
44
+ ProgramIterator (GrContext*, SkDeferredDisplayList*);
45
+ ~ProgramIterator ();
46
+
47
+ void compile ();
48
+ bool done () const ;
49
+ void next ();
50
+
51
+ private:
52
+ GrContext* fContext ;
53
+ const SkTArray<GrRecordingContext::ProgramData>& fProgramData ;
54
+ int fIndex ;
55
+ };
56
+ #endif
57
+
38
58
// Provides access to functions that aren't part of the public API.
39
59
SkDeferredDisplayListPriv priv ();
40
60
const SkDeferredDisplayListPriv priv () const ;
Original file line number Diff line number Diff line change 14
14
class SkSurfaceCharacterization ;
15
15
16
16
#if SK_SUPPORT_GPU
17
+ #include " src/gpu/GrContextPriv.h"
17
18
#include " src/gpu/GrRenderTask.h"
18
19
#include " src/gpu/ccpr/GrCCPerOpsTaskPaths.h"
19
20
#endif
@@ -28,3 +29,33 @@ SkDeferredDisplayList::SkDeferredDisplayList(const SkSurfaceCharacterization& ch
28
29
}
29
30
30
31
SkDeferredDisplayList::~SkDeferredDisplayList () {}
32
+
33
+ // -------------------------------------------------------------------------------------------------
34
+ #if SK_SUPPORT_GPU
35
+
36
+ SkDeferredDisplayList::ProgramIterator::ProgramIterator (GrContext* context,
37
+ SkDeferredDisplayList* ddl)
38
+ : fContext(context)
39
+ , fProgramData(ddl->programData ())
40
+ , fIndex(0 ) {
41
+ }
42
+
43
+ SkDeferredDisplayList::ProgramIterator::~ProgramIterator () {}
44
+
45
+ void SkDeferredDisplayList::ProgramIterator::compile () {
46
+ if (!fContext || fIndex < 0 || fIndex >= (int ) fProgramData .size ()) {
47
+ return ;
48
+ }
49
+
50
+ fContext ->priv ().compile (fProgramData [fIndex ].desc (), fProgramData [fIndex ].info ());
51
+ }
52
+
53
+ bool SkDeferredDisplayList::ProgramIterator::done () const {
54
+ return fIndex >= (int ) fProgramData .size ();
55
+ }
56
+
57
+ void SkDeferredDisplayList::ProgramIterator::next () {
58
+ ++fIndex ;
59
+ }
60
+
61
+ #endif
Original file line number Diff line number Diff line change @@ -164,11 +164,11 @@ void DDLTileHelper::createDDLsInParallel() {
164
164
// replay the DDL into a surface to make the tile image
165
165
// compose the tile image into the main canvas
166
166
static void do_gpu_stuff (GrContext* context, DDLTileHelper::TileData* tile) {
167
- auto & programData = tile->ddl ()->priv ().programData ();
168
167
169
168
// TODO: schedule program compilation as their own tasks
170
- for (auto & programDatum : programData) {
171
- context->priv ().compile (programDatum.desc (), programDatum.info ());
169
+ SkDeferredDisplayList::ProgramIterator iter (context, tile->ddl ());
170
+ for (; !iter.done (); iter.next ()) {
171
+ iter.compile ();
172
172
}
173
173
174
174
tile->draw (context);
You can’t perform that action at this time.
0 commit comments