7#include "flutter/lib/ui/painting/image_encoding.h"
8#include "flutter/lib/ui/painting/image_encoding_impl.h"
10#include "flutter/lib/ui/painting/image.h"
21 const std::shared_ptr<const fml::SyncSwitch>& is_gpu_disabled_sync_switch) {
24 auto image = dl_image->skia_image();
27 if (
image ==
nullptr) {
35 if (dimensions.isEmpty()) {
50 encode_task(raster_image);
55 if (!raster_task_runner) {
61 if (!io_task_runner) {
70 raster_task_runner->
PostTask([dl_image, encode_task = std::move(encode_task),
71 resource_context, snapshot_delegate,
72 io_task_runner, is_gpu_disabled_sync_switch,
73 raster_task_runner]() {
74 auto image = dl_image->skia_image();
75 if (!
image || !snapshot_delegate) {
77 [encode_task = encode_task]()
mutable { encode_task(
nullptr); });
82 snapshot_delegate->ConvertToRasterImage(
image);
85 raster_image = std::move(raster_image),
86 resource_context, is_gpu_disabled_sync_switch,
87 owning_context = dl_image->owning_context(),
88 raster_task_runner]()
mutable {
94 image, resource_context, is_gpu_disabled_sync_switch);
96 encode_task(raster_image);
sk_sp< SkImage > makeRasterImage(GrDirectContext *, CachingHint cachingHint=kDisallow_CachingHint) const
SkISize dimensions() const
bool peekPixels(SkPixmap *pixmap) const
virtual void PostTask(const fml::closure &task) override
#define FML_LOG(severity)
Dart_NativeFunction function
sk_sp< const SkImage > image
sk_sp< SkImage > ConvertToRasterUsingResourceContext(const sk_sp< SkImage > &image, const fml::WeakPtr< GrDirectContext > &resource_context, const std::shared_ptr< const SyncSwitch > &is_gpu_disabled_sync_switch)
void ConvertImageToRasterSkia(const sk_sp< DlImage > &dl_image, std::function< void(sk_sp< SkImage >)> encode_task, const fml::RefPtr< fml::TaskRunner > &raster_task_runner, const fml::RefPtr< fml::TaskRunner > &io_task_runner, const fml::WeakPtr< GrDirectContext > &resource_context, const fml::TaskRunnerAffineWeakPtr< SnapshotDelegate > &snapshot_delegate, const std::shared_ptr< const fml::SyncSwitch > &is_gpu_disabled_sync_switch)