66 {
68
70 if (
info.fFinishedProc) {
72 }
73
75 if (!
info.fRecording) {
78 }
79 SKGPU_LOG_E(
"No valid Recording passed into addRecording call");
80 return false;
81 }
82
84 uint32_t* recordingID = fLastAddedRecordingIDs.
find(
info.fRecording->priv().recorderID());
85 if (recordingID &&
86 info.fRecording->priv().uniqueID() != *recordingID+1) {
89 }
90 SKGPU_LOG_E(
"Recordings are expected to be replayed in order");
91 return false;
92 }
93
94
95 fLastAddedRecordingIDs.
set(
info.fRecording->priv().recorderID(),
96 info.fRecording->priv().uniqueID());
97 }
98
99 if (
info.fTargetSurface &&
103 }
104 info.fRecording->priv().setFailureResultForFinishedProcs();
105 SKGPU_LOG_E(
"Target surface passed into addRecording call is not graphite-backed");
106 return false;
107 }
108
109 auto resourceProvider = context->priv().resourceProvider();
110 if (!this->setupCommandBuffer(resourceProvider)) {
113 }
114 info.fRecording->priv().setFailureResultForFinishedProcs();
116 return false;
117 }
118
119 if (
info.fRecording->priv().hasNonVolatileLazyProxies()) {
120 if (!
info.fRecording->priv().instantiateNonVolatileLazyProxies(resourceProvider)) {
123 }
124 info.fRecording->priv().setFailureResultForFinishedProcs();
125 SKGPU_LOG_E(
"Non-volatile PromiseImage instantiation has failed");
126 return false;
127 }
128 }
129
130 if (
info.fRecording->priv().hasVolatileLazyProxies()) {
131 if (!
info.fRecording->priv().instantiateVolatileLazyProxies(resourceProvider)) {
134 }
135 info.fRecording->priv().setFailureResultForFinishedProcs();
136 info.fRecording->priv().deinstantiateVolatileLazyProxies();
137 SKGPU_LOG_E(
"Volatile PromiseImage instantiation has failed");
138 return false;
139 }
140 }
141
143 if (!
info.fRecording->priv().addCommands(context,
146 info.fTargetTranslation)) {
149 }
150 info.fRecording->priv().setFailureResultForFinishedProcs();
151 info.fRecording->priv().deinstantiateVolatileLazyProxies();
152 SKGPU_LOG_E(
"Adding Recording commands to the CommandBuffer has failed");
153 return false;
154 }
156 if (
info.fTargetTextureState) {
158 info.fTargetTextureState);
159 }
160
163 }
164
165 info.fRecording->priv().deinstantiateVolatileLazyProxies();
166
167 return true;
168}
bool isGraphiteBacked() const
bool requireOrderedRecordings() const
V * find(const K &key) const
#define TRACE_EVENT0(category_group, name)