Definition at line 157 of file CubeActivity.java.
◆ CubeRenderer()
org.skia.jetskidemo.CubeRenderer.CubeRenderer |
( |
Resources |
res | ) |
|
|
inline |
Definition at line 166 of file CubeActivity.java.
166 {
167 final float rot = (
float) Math.PI;
168 mFaces =
new Face[] {
169 new Face(0, -rot/2,
new ImageShaderSample(res,
R.raw.brickwork_texture)),
170 new Face(0, 0 ,
new SkottieSample(res,
R.raw.im_thirsty)),
171 new Face(0, rot ,
new RuntimeSample(res,
R.raw.runtime_shader1)),
172 new Face(rot/2, 0 ,
new SkottieSample(res,
R.raw.permission)),
173 new Face(0, rot/2 ,
new RuntimeSample(res,
R.raw.runtime_shader2)),
174 };
175 }
◆ onDown()
boolean org.skia.jetskidemo.CubeRenderer.onDown |
( |
MotionEvent |
e | ) |
|
|
inline |
Definition at line 256 of file CubeActivity.java.
256 {
258 return true;
259 }
void startDrag(MotionEvent e)
◆ onFling()
boolean org.skia.jetskidemo.CubeRenderer.onFling |
( |
MotionEvent |
e1, |
|
|
MotionEvent |
e2, |
|
|
float |
dx, |
|
|
float |
dy |
|
) |
| |
|
inline |
Definition at line 250 of file CubeActivity.java.
250 {
252 return true;
253 }
void fling(float dx, float dy)
skia_private::AutoTArray< sk_sp< SkImageFilter > > filters TypedMatrix matrix TypedMatrix matrix SkScalar dx
◆ onLongPress()
void org.skia.jetskidemo.CubeRenderer.onLongPress |
( |
MotionEvent |
e | ) |
|
|
inline |
◆ onRenderFrame()
void org.skia.jetskidemo.CubeRenderer.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 204 of file CubeActivity.java.
204 {
205 if (mPrevMS == 0) {
206 mPrevMS = ms;
207 }
208
209 mVSphere.
animate((ms - mPrevMS) / 1000.
f);
210 mPrevMS = ms;
211
212
213
214 canvas.drawColor(0xffffffff);
215
216 canvas.save();
217 canvas.concat(mViewMatrix);
218 canvas.scale(mZoom, mZoom);
220
221 drawFaces(canvas, ms, false);
222 drawFaces(canvas, ms, true);
223
224 canvas.restore();
225 }
◆ onScale()
boolean org.skia.jetskidemo.CubeRenderer.onScale |
( |
ScaleGestureDetector |
detector | ) |
|
|
inline |
Definition at line 289 of file CubeActivity.java.
289 {
290 zoom(detector.getScaleFactor());
291 return true;
292 }
◆ onScaleBegin()
boolean org.skia.jetskidemo.CubeRenderer.onScaleBegin |
( |
ScaleGestureDetector |
detector | ) |
|
|
inline |
Definition at line 295 of file CubeActivity.java.
295 {
296 zoom(detector.getScaleFactor());
297 return true;
298 }
◆ onScaleEnd()
void org.skia.jetskidemo.CubeRenderer.onScaleEnd |
( |
ScaleGestureDetector |
detector | ) |
|
|
inline |
◆ onScroll()
boolean org.skia.jetskidemo.CubeRenderer.onScroll |
( |
MotionEvent |
e1, |
|
|
MotionEvent |
e2, |
|
|
float |
dx, |
|
|
float |
dy |
|
) |
| |
|
inline |
◆ onShowPress()
void org.skia.jetskidemo.CubeRenderer.onShowPress |
( |
MotionEvent |
e | ) |
|
|
inline |
◆ onSingleTapUp()
boolean org.skia.jetskidemo.CubeRenderer.onSingleTapUp |
( |
MotionEvent |
e | ) |
|
|
inline |
◆ onSurfaceInitialized()
void org.skia.jetskidemo.CubeRenderer.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 178 of file CubeActivity.java.
178 {
179 float cx =
surface.getWidth() / 2,
181 r = Math.min(cx, cy);
182
183 mVSphere = new VSphereAnimator(cx, cy, r);
184
185
186 float vsz = r * 2;
187
188 mCubeSideLength = vsz * 0.5f;
189
190 float viewAngle = (
float)Math.PI / 4
f,
191 viewDistance = (float)(r / tan(viewAngle/2));
192
193 mViewMatrix =
new Matrix()
194
195 .translate(cx, cy)
196
197 .scale(vsz/2, vsz/2, 1)
198 .preConcat(
Matrix.makePerspective(0.05f, viewDistance, viewAngle))
199
200 .preConcat(
Matrix.makeLookAt(0, 0, -viewDistance, 0, 0, 0, 0, 1, 0));
201 }
SK_API sk_sp< PrecompileColorFilter > Matrix()
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/CubeActivity.java