Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 8bc7861

Browse files
committed
fix lint error
1 parent 06acb0d commit 8bc7861

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

lib/ui/painting/image_encoding_skia.cc

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ void ConvertImageToRasterSkia(
1717
const fml::WeakPtr<GrDirectContext>& resource_context,
1818
const fml::TaskRunnerAffineWeakPtr<SnapshotDelegate>& snapshot_delegate,
1919
const std::shared_ptr<const fml::SyncSwitch>& is_gpu_disabled_sync_switch) {
20-
FML_DCHECK(raster_task_runner && io_task_runner);
21-
2220
// If the owning_context is kRaster, we can't access it on this task runner.
2321
if (dl_image->owning_context() != DlImage::OwningContext::kRaster) {
2422
auto image = dl_image->skia_image();
@@ -52,6 +50,18 @@ void ConvertImageToRasterSkia(
5250
}
5351
}
5452

53+
if (!raster_task_runner) {
54+
FML_LOG(ERROR) << "Raster task runner was null.";
55+
encode_task(nullptr);
56+
return;
57+
}
58+
59+
if (!io_task_runner) {
60+
FML_LOG(ERROR) << "IO task runner was null.";
61+
encode_task(nullptr);
62+
return;
63+
}
64+
5565
// Cross-context images do not support makeRasterImage. Convert these images
5666
// by drawing them into a surface. This must be done on the raster thread
5767
// to prevent concurrent usage of the image on both the IO and raster threads.

0 commit comments

Comments
 (0)