This commit is contained in:
khanhduytran0 2020-11-05 17:46:17 +07:00
parent 39e250aa57
commit 189793020c

View File

@ -77,11 +77,11 @@ public class AWTCanvasView extends TextureView implements TextureView.SurfaceTex
private Surface mSurface;
@Override
public void run() {
try {
Canvas canvas;
mSurface = new Surface(getSurfaceTexture());
Canvas canvas;
mSurface = new Surface(getSurfaceTexture());
while (!mIsDestroyed) {
while (!mIsDestroyed && mSurface.isValid()) {
try {
canvas = mSurface.lockCanvas(null);
canvas.drawRGB(0, 0, 0);
@ -94,9 +94,9 @@ public class AWTCanvasView extends TextureView implements TextureView.SurfaceTex
canvas.drawText("FPS: " + fps() + ", attached=" + attached + ", drawing=" + drawing, 50, 50, fpsPaint);
mSurface.unlockCanvasAndPost(canvas);
} catch (Throwable th) {
th.printStackTrace();
}
} catch (Throwable th) {
Tools.showError(getContext(), th, true);
}
}
}