Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions app/src/main/runtime/display/renderer/VulkanRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
import android.view.Choreographer;
import android.view.Surface;
import androidx.preference.PreferenceManager;
import com.winlator.cmod.BuildConfig;
Expand Down Expand Up @@ -119,9 +117,6 @@ public void setSwapRB(boolean v) {

private final ByteBuffer sceneBuf =
ByteBuffer.allocateDirect(SCENE_BUF_SIZE).order(ByteOrder.nativeOrder());
private final Handler mainHandler = new Handler(Looper.getMainLooper());
private final AtomicBoolean renderRequested = new AtomicBoolean(false);

// Reusable scratch — sized once, refilled per frame.
private final float[] sceneXform = XForm.getInstance();
// Effect.writeParams writes into a float[]; we copy into the ByteBuffer afterwards.
Expand Down Expand Up @@ -169,13 +164,8 @@ public void destroy() {
}

public void requestRenderCoalesced() {
if (renderRequested.compareAndSet(false, true)) {
mainHandler.post(() ->
Choreographer.getInstance().postFrameCallback(frameTimeNanos -> {
renderRequested.set(false);
xServerView.requestRender();
}));
}
// Wake the render thread directly; the UI-thread/Choreographer hop stalls under touch input.
xServerView.requestRender();
}

private Drawable createRootCursorDrawable() {
Expand Down