mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-14 23:28:52 -04:00
[Mod installer] Fix errors on some devices
This commit is contained in:
parent
27c0f009a1
commit
73c8385bba
@ -80,8 +80,8 @@ public class AWTCanvasView extends TextureView implements TextureView.SurfaceTex
|
||||
Canvas canvas;
|
||||
mSurface = new Surface(getSurfaceTexture());
|
||||
|
||||
while (!mIsDestroyed) {
|
||||
try {
|
||||
while (!mIsDestroyed && mSurface.isAvailable()) {
|
||||
canvas = mSurface.lockCanvas(null);
|
||||
canvas.drawRGB(0, 0, 0);
|
||||
|
||||
@ -92,16 +92,15 @@ public class AWTCanvasView extends TextureView implements TextureView.SurfaceTex
|
||||
if (rgbArray == null) {
|
||||
drawing = false;
|
||||
} else {
|
||||
// canvas.drawText("FPS", 50, 50, fpsPaint);
|
||||
canvas.drawBitmap(rgbArray, 0, mWidth, 0, 0, mWidth, mHeight, true, null);
|
||||
canvas.drawBitmap(rgbArray, 0, CallbackBridge.windowWidth, 0, 0, CallbackBridge.windowWidth, callbackBridge.windowHeight, true, null);
|
||||
}
|
||||
}
|
||||
canvas.drawText("FPS: " + (Math.round(fps() * 10) / 10) + ", attached=" + attached + ", drawing=" + drawing, 50, 50, fpsPaint);
|
||||
|
||||
mSurface.unlockCanvasAndPost(canvas);
|
||||
}
|
||||
} catch (Throwable th) {
|
||||
th.printStackTrace();
|
||||
}
|
||||
Tools.showError(getContext(), th);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user