Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
org.skia.jetskidemo.samples.RuntimeSample Class Reference
Inheritance diagram for org.skia.jetskidemo.samples.RuntimeSample:
org.skia.jetskidemo.samples.Sample

Public Member Functions

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

Detailed Description

Definition at line 19 of file RuntimeSample.java.

Constructor & Destructor Documentation

◆ RuntimeSample()

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

Definition at line 22 of file RuntimeSample.java.

22 {
23 String sksl = "";
24 try {
25 InputStream is = res.openRawResource(resId);
26 byte[] data = new byte[is.available()];
27 is.read(data);
28
29 sksl = new String(data);
30 } catch (Exception e) {}
31
32 mShaderBuilder = new RuntimeShaderBuilder(sksl);
33 }
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot data
Definition switches.h:41

Member Function Documentation

◆ render()

void org.skia.jetskidemo.samples.RuntimeSample.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 35 of file RuntimeSample.java.

35 {
36 mShaderBuilder.setUniform("u_time", ms / 1000.0f)
37 .setUniform("u_w", right - left)
38 .setUniform("u_h", bottom - top);
39
40 Paint paint = new Paint().setShader(mShaderBuilder.makeShader());
41
42 canvas.save();
43 canvas.concat(new Matrix().translate(left, top));
44 canvas.drawRect(0, 0, right - left, bottom - top, paint);
45 canvas.restore();
46 }
static bool left(const SkPoint &p0, const SkPoint &p1)
static bool right(const SkPoint &p0, const SkPoint &p1)
const Paint & paint

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