Flutter Engine
The Flutter Engine
Protected Member Functions | List of all members
org.skia.jetskidemo.MainActivity.DemoRuntimeShaderRenderer Class Reference
Inheritance diagram for org.skia.jetskidemo.MainActivity.DemoRuntimeShaderRenderer:
org.skia.jetski.util.SurfaceRenderer

Protected Member Functions

void onSurfaceInitialized (Surface surface)
 
void onRenderFrame (Canvas canvas, long ms)
 
abstract void onSurfaceInitialized (Surface surface)
 
abstract void onRenderFrame (Canvas canvas, long ms)
 

Additional Inherited Members

- Public Member Functions inherited from org.skia.jetski.util.SurfaceRenderer
void run ()
 
void surfaceCreated (SurfaceHolder holder)
 
void surfaceChanged (SurfaceHolder holder, int format, int width, int height)
 
void surfaceDestroyed (SurfaceHolder holder)
 
void setBaseTime (long millis)
 
void release ()
 

Detailed Description

Definition at line 139 of file MainActivity.java.

Member Function Documentation

◆ onRenderFrame()

void org.skia.jetskidemo.MainActivity.DemoRuntimeShaderRenderer.onRenderFrame ( Canvas  canvas,
long  ms 
)
inlineprotected

Callback for frame content.

Invoked once per (vsync'ed) frame.

Reimplemented from org.skia.jetski.util.SurfaceRenderer.

Definition at line 165 of file MainActivity.java.

165 {
166 final int w = canvas.getWidth();
167 final int h = canvas.getHeight();
168
169 Paint p = new Paint();
170 p.setShader(mBuilder.setUniform("u_time", ms/1000.0f)
171 .setUniform("u_w", w)
172 .setUniform("u_h", h)
173 .makeShader());
174
175 canvas.drawRect(0, 0, w, h, p);
176 }
void drawRect(float left, float top, float right, float bottom, Paint paint)
Definition: Canvas.java:95
RuntimeShaderBuilder setUniform(String name, float val)
SkScalar w
SkScalar h

◆ onSurfaceInitialized()

void org.skia.jetskidemo.MainActivity.DemoRuntimeShaderRenderer.onSurfaceInitialized ( Surface  surface)
inlineprotected

Initialization callback.

This can be invoked multiple times if the underlying surface changes.

Reimplemented from org.skia.jetski.util.SurfaceRenderer.

Definition at line 162 of file MainActivity.java.

162{}

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