From aec8a7b9d45d86d29b721047e8221017a13a7290 Mon Sep 17 00:00:00 2001 From: jonahwilliams Date: Mon, 20 Mar 2023 13:46:06 -0700 Subject: [PATCH] [impeller] serialize texture upload --- lib/ui/painting/image_decoder_impeller.cc | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/lib/ui/painting/image_decoder_impeller.cc b/lib/ui/painting/image_decoder_impeller.cc index a6a130b3932c0..5fa07ec4c8491 100644 --- a/lib/ui/painting/image_decoder_impeller.cc +++ b/lib/ui/painting/image_decoder_impeller.cc @@ -341,14 +341,11 @@ void ImageDecoderImpeller::Decode(fml::RefPtr descriptor, auto upload_texture_and_invoke_result = [result, context, bitmap]() { result(UploadTexture(context, bitmap)); }; - // Depending on whether the context has threading restrictions, stay on - // the concurrent runner to perform texture upload or move to an IO - // runner. - if (context->GetDeviceCapabilities().HasThreadingRestrictions()) { - io_runner->PostTask(upload_texture_and_invoke_result); - } else { - upload_texture_and_invoke_result(); - } + // TODO(jonahwilliams): https://github.com/flutter/flutter/issues/123058 + // Technically we don't need to post tasks to the io runner, but without + // this forced serialization we can end up overloading the GPU and/or + // competing with raster workloads. + io_runner->PostTask(upload_texture_and_invoke_result); }); }