Definition at line 19 of file SkottieSample.java.
◆ SkottieSample()
org.skia.jetskidemo.samples.SkottieSample.SkottieSample |
( |
Resources |
res, |
|
|
int |
resId |
|
) |
| |
|
inline |
Definition at line 23 of file SkottieSample.java.
23 {
24 String json = "";
25
26 try {
27 InputStream is = res.openRawResource(resId);
28 byte[]
data =
new byte[is.available()];
29 is.read(data);
30 json = new String(data);
31 } catch (Exception e) {}
32
34 }
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot data
◆ render()
void org.skia.jetskidemo.samples.SkottieSample.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 36 of file SkottieSample.java.
36 {
37 canvas.drawRect(
left, top,
right, bottom, mClearPaint);
38
39 double t = (double)ms / 1000 % mAnimation.getDuration();
40 mAnimation.seekTime(t);
41
44 s = Math.min(
w / mAnimation.getWidth(),
45 h / mAnimation.getHeight());
46
47 canvas.save();
48 canvas.concat(
new Matrix().translate(
left + (
w -
s*mAnimation.getWidth() )/2,
49 top + (
h -
s*mAnimation.getHeight())/2)
51
52 mAnimation.render(canvas);
53 canvas.restore();
54 }
static bool left(const SkPoint &p0, const SkPoint &p1)
static bool right(const SkPoint &p0, const SkPoint &p1)
The documentation for this class was generated from the following file:
- third_party/skia/platform_tools/android/apps/jetskidemo/src/main/java/org/skia/jetskidemo/samples/SkottieSample.java