- [Mod installer] Fix crash when put t background.
- Tools.java: replace tabs with 4-spaces
This commit is contained in:
khanhduytran0 2020-11-05 17:43:28 +07:00
parent ab2e9e68b1
commit 39e250aa57
2 changed files with 728 additions and 736 deletions

View file

@ -77,19 +77,26 @@ public class AWTCanvasView extends TextureView implements TextureView.SurfaceTex
private Surface mSurface; private Surface mSurface;
@Override @Override
public void run() { public void run() {
Canvas canvas; try {
mSurface = new Surface(getSurfaceTexture()); Canvas canvas;
mSurface = new Surface(getSurfaceTexture());
while (!mIsDestroyed) { while (!mIsDestroyed) {
canvas = mSurface.lockCanvas(null); canvas = mSurface.lockCanvas(null);
if (!attached) { canvas.drawRGB(0, 0, 0);
attached = CallbackBridge.nativeAttachThreadToOther(true, MainActivity.isInputStackCall);
if (!attached) {
attached = CallbackBridge.nativeAttachThreadToOther(true, MainActivity.isInputStackCall);
}
if (attached) {
drawing = JREUtils.renderAWTScreenFrame(canvas, mWidth, mHeight);
}
canvas.drawText("FPS: " + fps() + ", attached=" + attached + ", drawing=" + drawing, 50, 50, fpsPaint);
mSurface.unlockCanvasAndPost(canvas);
} }
if (attached) { } catch (Throwable th) {
drawing = JREUtils.renderAWTScreenFrame(canvas, mWidth, mHeight); Tools.showError(getContext(), th, true);
}
canvas.drawText("FPS: " + fps() + ", drawing=" + drawing, 10, 10, fpsPaint);
mSurface.unlockCanvasAndPost(canvas);
} }
} }
} }

File diff suppressed because it is too large Load diff