Flutter Engine
flutter::ImageShader Class Reference

#include <image_shader.h>

Inheritance diagram for flutter::ImageShader:
flutter::Shader flutter::RefCountedDartWrappable< Shader > fml::RefCountedThreadSafe< Shader > tonic::DartWrappable fml::internal::RefCountedThreadSafeBase

Public Member Functions

 ~ImageShader () override
 
void initWithImage (CanvasImage *image, SkTileMode tmx, SkTileMode tmy, const tonic::Float64List &matrix4)
 
- Public Member Functions inherited from flutter::Shader
 ~Shader () override
 
sk_sp< SkShader > shader ()
 
void set_shader (flutter::SkiaGPUObject< SkShader > shader)
 
- Public Member Functions inherited from flutter::RefCountedDartWrappable< Shader >
virtual void RetainDartWrappableReference () const override
 
virtual void ReleaseDartWrappableReference () const override
 
- Public Member Functions inherited from fml::RefCountedThreadSafe< Shader >
void Release () const
 
- Public Member Functions inherited from fml::internal::RefCountedThreadSafeBase
void AddRef () const
 
bool HasOneRef () const
 
void AssertHasOneRef () const
 
- Public Member Functions inherited from tonic::DartWrappable
 DartWrappable ()
 
virtual const DartWrapperInfoGetDartWrapperInfo () const =0
 
virtual size_t GetAllocationSize () const
 
Dart_Handle CreateDartWrapper (DartState *dart_state)
 
void AssociateWithDartWrapper (Dart_Handle wrappable)
 
void ClearDartWrapper ()
 
Dart_WeakPersistentHandle dart_wrapper () const
 

Static Public Member Functions

static fml::RefPtr< ImageShaderCreate ()
 
static void RegisterNatives (tonic::DartLibraryNatives *natives)
 

Additional Inherited Members

- Public Types inherited from tonic::DartWrappable
enum  DartNativeFields {
  kPeerIndex,
  kWrapperInfoIndex,
  kNumberOfNativeFields
}
 
- Protected Member Functions inherited from flutter::Shader
 Shader (flutter::SkiaGPUObject< SkShader > shader={})
 
- Protected Member Functions inherited from fml::RefCountedThreadSafe< Shader >
 RefCountedThreadSafe ()
 
 ~RefCountedThreadSafe ()
 
- Protected Member Functions inherited from fml::internal::RefCountedThreadSafeBase
 RefCountedThreadSafeBase ()
 
 ~RefCountedThreadSafeBase ()
 
bool Release () const
 
void Adopt ()
 
- Protected Member Functions inherited from tonic::DartWrappable
virtual ~DartWrappable ()
 
- Static Protected Member Functions inherited from tonic::DartWrappable
static Dart_PersistentHandle GetTypeForWrapper (tonic::DartState *dart_state, const tonic::DartWrapperInfo &wrapper_info)
 

Detailed Description

Definition at line 23 of file image_shader.h.

Constructor & Destructor Documentation

◆ ~ImageShader()

flutter::ImageShader::~ImageShader ( )
overridedefault

Referenced by initWithImage().

Member Function Documentation

◆ Create()

fml::RefPtr< ImageShader > flutter::ImageShader::Create ( )
static

Definition at line 33 of file image_shader.cc.

Referenced by flutter::ImageShader_constructor().

33  {
34  return fml::MakeRefCounted<ImageShader>();
35 }

◆ initWithImage()

void flutter::ImageShader::initWithImage ( CanvasImage image,
SkTileMode  tmx,
SkTileMode  tmy,
const tonic::Float64List &  matrix4 
)

Definition at line 37 of file image_shader.cc.

References flutter::UIDartState::CreateGPUObject(), flutter::CanvasImage::image(), flutter::Shader::set_shader(), tonic::ToDart(), flutter::ToSkMatrix(), and ~ImageShader().

40  {
41  if (!image) {
42  Dart_ThrowException(
43  ToDart("ImageShader constructor called with non-genuine Image."));
44  return;
45  }
46  SkMatrix sk_matrix = ToSkMatrix(matrix4);
48  image->image()->makeShader(tmx, tmy, &sk_matrix)));
49 }
void set_shader(flutter::SkiaGPUObject< SkShader > shader)
Definition: shader.h:24
Dart_Handle ToDart(const T &object)
SkMatrix ToSkMatrix(const tonic::Float64List &matrix4)
Definition: matrix.cc:20
static flutter::SkiaGPUObject< T > CreateGPUObject(sk_sp< T > object)
Definition: ui_dart_state.h:78

◆ RegisterNatives()

void flutter::ImageShader::RegisterNatives ( tonic::DartLibraryNatives natives)
static

Definition at line 27 of file image_shader.cc.

References DART_REGISTER_NATIVE, FOR_EACH_BINDING, and flutter::ImageShader_constructor().

Referenced by flutter::DartUI::InitForGlobal().

27  {
28  natives->Register(
29  {{"ImageShader_constructor", ImageShader_constructor, 1, true},
31 }
static void ImageShader_constructor(Dart_NativeArguments args)
Definition: image_shader.cc:17
void Register(std::initializer_list< Entry > entries)
#define DART_REGISTER_NATIVE(CLASS, METHOD)
#define FOR_EACH_BINDING(V)
Definition: image_shader.cc:23

The documentation for this class was generated from the following files: