From 5dd7504a3711baf3ed70e197c50f8b01fedf443f Mon Sep 17 00:00:00 2001 From: "pengfei.zhou" Date: Wed, 27 Jul 2022 12:03:41 +0800 Subject: [PATCH] android: Ensure that rendering operations are serialized to prevent timing errors --- .../doric/src/main/java/pub/doric/plugin/ShaderPlugin.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doric-android/doric/src/main/java/pub/doric/plugin/ShaderPlugin.java b/doric-android/doric/src/main/java/pub/doric/plugin/ShaderPlugin.java index fd483649..2afb6846 100644 --- a/doric-android/doric/src/main/java/pub/doric/plugin/ShaderPlugin.java +++ b/doric-android/doric/src/main/java/pub/doric/plugin/ShaderPlugin.java @@ -53,7 +53,7 @@ public class ShaderPlugin extends DoricJavaPlugin { super(doricContext); } - @DoricMethod + @DoricMethod(thread = ThreadMode.UI) public void render(final JSObject jsObject, final DoricPromise promise) { final DoricPerformanceProfile profile = getDoricContext().getPerformanceProfile(); profile.prepare(DoricPerformanceProfile.STEP_RENDER); @@ -120,7 +120,7 @@ public class ShaderPlugin extends DoricJavaPlugin { }); } - @DoricMethod + @DoricMethod(thread = ThreadMode.UI) public void command(final JSObject jsObject, final DoricPromise doricPromise) { getDoricContext().getDriver().asyncCall(new Callable() { @Override