5#include "flutter/lib/ui/painting/image_shader.h"
6#include "flutter/lib/ui/painting/image_filter.h"
8#include "flutter/lib/ui/painting/display_list_image_gpu.h"
9#include "flutter/lib/ui/ui_dart_state.h"
22 auto res = fml::MakeRefCounted<ImageShader>();
23 res->AssociateWithDartWrapper(wrapper);
29 int filter_quality_index,
32 if (!
image || !
image->image()->isUIThreadSafe()) {
33 return ToDart(
"ImageShader constructor called with non-genuine Image.");
36 image_ =
image->image();
37 tonic::Float64List matrix4(matrix_handle);
40 sampling_is_locked_ = filter_quality_index >= 0;
44 cached_shader_ = std::make_shared<DlImageColorSource>(
51 if (sampling_is_locked_ ||
sampling == cached_shader_->sampling()) {
52 return cached_shader_;
54 return cached_shader_->with_sampling(
sampling);
58 return image_->width();
62 return image_->height();
66 cached_shader_.reset();
71ImageShader::ImageShader() =
default;
static DlImageSampling SamplingFromIndex(int filterQualityIndex)
std::shared_ptr< DlColorSource > shader(DlImageSampling) override
Dart_Handle initWithImage(CanvasImage *image, DlTileMode tmx, DlTileMode tmy, int filter_quality_index, Dart_Handle matrix_handle)
static void Create(Dart_Handle wrapper)
struct _Dart_Handle * Dart_Handle
DART_EXPORT Dart_Handle Dart_Null(void)
#define FML_DCHECK(condition)
sk_sp< const SkImage > image
SkSamplingOptions sampling
IMPLEMENT_WRAPPERTYPEINFO(flutter_gpu, FlutterGpuTestClass)
constexpr SkMatrix ToSkMatrix(const DlMatrix &matrix)
Dart_Handle ToDart(const T &object)