8package org.skia.jetski.util;
11import android.view.SurfaceHolder;
12import org.
skia.jetski.Canvas;
13import org.skia.jetski.Surface;
21 private android.view.Surface mAndroidSurface;
22 private Thread mRenderThread;
23 private boolean mThreadRunning;
24 private long mTimeBase;
42 Log.d(
"SurfaceRenderer",
"Render thread started.");
48 mTimeBase = java.lang.System.currentTimeMillis();
50 while (mThreadRunning) {
51 long timestamp = java.lang.System.currentTimeMillis() - mTimeBase;
59 Log.d(
"SurfaceRenderer",
"Render thread finished.");
69 mAndroidSurface = holder.getSurface();
80 private void startRenderThread() {
81 if (!mThreadRunning) {
82 mThreadRunning =
true;
83 mRenderThread =
new Thread(
this);
84 mRenderThread.start();
88 private void stopRenderThread() {
90 mThreadRunning =
false;
93 }
catch (InterruptedException
e) {}
static Surface CreateGL(android.view.Surface surface)
void surfaceDestroyed(SurfaceHolder holder)
abstract void onSurfaceInitialized(Surface surface)
abstract void onRenderFrame(Canvas canvas, long ms)
void surfaceChanged(SurfaceHolder holder, int format, int width, int height)
void setBaseTime(long millis)
void surfaceCreated(SurfaceHolder holder)
uint32_t uint32_t * format
void Log(const char *format,...) SK_PRINTF_LIKE(1
std::function< void(MTLRenderPipelineDescriptor *)> Callback