Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
org.skia.jetskidemo.samples.ImageShaderSample Class Reference
Inheritance diagram for org.skia.jetskidemo.samples.ImageShaderSample:
org.skia.jetskidemo.samples.Sample

Public Member Functions

 ImageShaderSample (Resources res, int resId)
 
void render (Canvas canvas, long t, float left, float top, float right, float bottom)
 
void render (Canvas canvas, long t, float left, float top, float right, float bottom)
 

Detailed Description

Definition at line 19 of file ImageShaderSample.java.

Constructor & Destructor Documentation

◆ ImageShaderSample()

org.skia.jetskidemo.samples.ImageShaderSample.ImageShaderSample ( Resources  res,
int  resId 
)
inline

Definition at line 22 of file ImageShaderSample.java.

22 {
23 try {
24 Image image = Image.fromStream(res.openRawResource(resId));
25 Shader shader =
26 image.makeShader(TileMode.REPEAT, TileMode.REPEAT,
27 new SamplingOptions(SamplingOptions.FilterMode.LINEAR));
28 mPaint.setShader(shader);
29 } catch (Exception e) {}
30 }
Paint setShader(@Nullable Shader shader)
Definition: Paint.java:34
sk_sp< const SkImage > image
Definition: SkRecords.h:269
CanvasImage Image
Definition: dart_ui.cc:55
SkTileMode TileMode(jint tm)
Definition: Utils.cpp:26
SkSamplingOptions SamplingOptions(jint desc, jfloat coeffB, jfloat coeffC)
Definition: Utils.cpp:13

Member Function Documentation

◆ render()

void org.skia.jetskidemo.samples.ImageShaderSample.render ( Canvas  canvas,
long  t,
float  left,
float  top,
float  right,
float  bottom 
)
inline

Renders a Sample frame t (ms) into the destination rect [L T R B].

Implements org.skia.jetskidemo.samples.Sample.

Definition at line 32 of file ImageShaderSample.java.

32 {
33 canvas.drawRect(left, top, right, bottom, mPaint);
34 }

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