207 {
208 if (!mapping) {
209 return false;
210 }
211
212 if (mapping->GetSize() == 0u) {
213 return true;
214 }
215
216 if (mapping->GetMapping() == nullptr) {
217 return false;
218 }
219
221 VALIDATION_LOG <<
"Incorrect texture usage flags for setting contents on "
222 "this texture object.";
223 return false;
224 }
225
226 if (is_wrapped_) {
227 VALIDATION_LOG <<
"Cannot set the contents of a wrapped texture.";
228 return false;
229 }
230
232
233 if (tex_descriptor.size.IsEmpty()) {
234 return true;
235 }
236
237 if (!tex_descriptor.IsValid()) {
238 return false;
239 }
240
241 if (mapping->GetSize() < tex_descriptor.GetByteSizeOfBaseMipLevel()) {
242 return false;
243 }
244
245 GLenum texture_type;
246 GLenum texture_target;
247 switch (tex_descriptor.type) {
249 texture_type = GL_TEXTURE_2D;
250 texture_target = GL_TEXTURE_2D;
251 break;
253 VALIDATION_LOG <<
"Multisample texture uploading is not supported for "
254 "the OpenGLES backend.";
255 return false;
257 texture_type = GL_TEXTURE_CUBE_MAP;
258 texture_target = GL_TEXTURE_CUBE_MAP_POSITIVE_X + slice;
259 break;
261 texture_type = GL_TEXTURE_EXTERNAL_OES;
262 texture_target = GL_TEXTURE_EXTERNAL_OES;
263 break;
264 }
265
266 auto data = std::make_shared<TexImage2DData>(tex_descriptor.format,
267 std::move(mapping));
268 if (!data || !
data->IsValid()) {
270 return false;
271 }
272
275 size = tex_descriptor.size,
276 texture_type,
277 texture_target
278 ](const auto& reactor) {
279 auto gl_handle = reactor.GetGLHandle(handle);
280 if (!gl_handle.has_value()) {
282 << "Texture was collected before it could be uploaded to the GPU.";
283 return;
284 }
285 const auto&
gl = reactor.GetProcTable();
286 gl.BindTexture(texture_type, gl_handle.value());
287 const GLvoid* tex_data = nullptr;
289 tex_data =
data->data->GetMapping();
290 }
291
292 {
294 std::to_string(
data->data->GetSize()).c_str());
295 gl.TexImage2D(texture_target,
296 0u,
297 data->internal_format,
300 0u,
301 data->external_format,
303 tex_data
304 );
305 }
306 };
307
308 contents_initialized_ = reactor_->AddOperation(texture_upload);
309 return contents_initialized_;
310}
std::function< void(const ReactorGLES &reactor)> Operation
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot data
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
#define TRACE_EVENT1(category_group, name, arg1_name, arg1_val)