mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-09 20:58:31 +09:00
[Fix] (trace-replay): pass ANGLE path to APK retrace
This commit is contained in:
@@ -129,6 +129,12 @@ bool LoadMobileGL(const Request& request, std::string& error) {
|
||||
setenv("MOBILEGL_TRACE_SKIP_AUTODESTROY", "1", 1);
|
||||
if (UseAngleForRequest(request)) {
|
||||
setenv("MOBILEGL_RETRACE_USE_ANGLE", "1", 1);
|
||||
if (!request.angleLibraryDir.empty()) {
|
||||
setenv("MOBILEGL_RETRACE_ANGLE_DIR", request.angleLibraryDir.c_str(), 1);
|
||||
}
|
||||
} else {
|
||||
unsetenv("MOBILEGL_RETRACE_USE_ANGLE");
|
||||
unsetenv("MOBILEGL_RETRACE_ANGLE_DIR");
|
||||
}
|
||||
|
||||
void* handle = dlopen(request.mobileGlLibrary.c_str(), RTLD_NOW | RTLD_GLOBAL);
|
||||
@@ -738,6 +744,7 @@ bool WriteResultJson(const Request& request, const Result& result) {
|
||||
file << " \"actualPath\": \"" << JsonEscape(result.actualPath) << "\",\n";
|
||||
file << " \"diffPath\": \"" << JsonEscape(result.diffPath) << "\",\n";
|
||||
file << " \"backend\": \"" << JsonEscape(request.backend) << "\",\n";
|
||||
file << " \"angleLibraryDir\": \"" << JsonEscape(request.angleLibraryDir) << "\",\n";
|
||||
file << " \"targetFrame\": " << request.targetFrame << ",\n";
|
||||
file << " \"targetCall\": " << request.targetCall << ",\n";
|
||||
file << " \"width\": " << request.width << ",\n";
|
||||
|
||||
@@ -23,6 +23,7 @@ struct Request {
|
||||
std::string diffPath;
|
||||
std::string backend;
|
||||
std::string mobileGlLibrary = "libMobileGL.so";
|
||||
std::string angleLibraryDir;
|
||||
int targetFrame = -1;
|
||||
long long targetCall = -1;
|
||||
int width = 0;
|
||||
|
||||
@@ -99,6 +99,7 @@ Java_top_mobilegl_plugin_trace_TraceReplayActivity_nativeRunTraceReplay(JNIEnv*
|
||||
jint cropWidth,
|
||||
jint cropHeight,
|
||||
jint fuzzPercent,
|
||||
jstring angleLibraryDir,
|
||||
jboolean useAngle) {
|
||||
mobilegl_trace::Request request;
|
||||
request.tracePath = ToString(env, tracePath);
|
||||
@@ -110,6 +111,7 @@ Java_top_mobilegl_plugin_trace_TraceReplayActivity_nativeRunTraceReplay(JNIEnv*
|
||||
request.outputDir = ToString(env, outputDir);
|
||||
request.diffPath = ToString(env, diffPath);
|
||||
request.backend = ToString(env, backend);
|
||||
request.angleLibraryDir = ToString(env, angleLibraryDir);
|
||||
request.targetFrame = targetFrame;
|
||||
request.targetCall = targetCall;
|
||||
request.width = width;
|
||||
|
||||
+8
-1
@@ -44,6 +44,7 @@ public final class TraceReplayActivity extends Activity {
|
||||
request = TraceReplayRequest.from(
|
||||
intent,
|
||||
getFilesDir(),
|
||||
getApplicationInfo().nativeLibraryDir,
|
||||
getString(top.mobilegl.plugin.R.string.mobilegl_default_backend)
|
||||
);
|
||||
statusView = new TextView(this);
|
||||
@@ -111,6 +112,7 @@ public final class TraceReplayActivity extends Activity {
|
||||
request.cropWidth,
|
||||
request.cropHeight,
|
||||
request.fuzzPercent,
|
||||
request.angleLibraryDir,
|
||||
request.useAngle
|
||||
);
|
||||
Log.i(TAG, result.toString());
|
||||
@@ -139,6 +141,7 @@ public final class TraceReplayActivity extends Activity {
|
||||
int cropWidth,
|
||||
int cropHeight,
|
||||
int fuzzPercent,
|
||||
String angleLibraryDir,
|
||||
boolean useAngle
|
||||
);
|
||||
|
||||
@@ -159,6 +162,7 @@ public final class TraceReplayActivity extends Activity {
|
||||
final int cropWidth;
|
||||
final int cropHeight;
|
||||
final int fuzzPercent;
|
||||
final String angleLibraryDir;
|
||||
final boolean useAngle;
|
||||
|
||||
private TraceReplayRequest(
|
||||
@@ -178,6 +182,7 @@ public final class TraceReplayActivity extends Activity {
|
||||
int cropWidth,
|
||||
int cropHeight,
|
||||
int fuzzPercent,
|
||||
String angleLibraryDir,
|
||||
boolean useAngle
|
||||
) {
|
||||
this.tracePath = tracePath;
|
||||
@@ -196,10 +201,11 @@ public final class TraceReplayActivity extends Activity {
|
||||
this.cropWidth = cropWidth;
|
||||
this.cropHeight = cropHeight;
|
||||
this.fuzzPercent = fuzzPercent;
|
||||
this.angleLibraryDir = angleLibraryDir;
|
||||
this.useAngle = useAngle;
|
||||
}
|
||||
|
||||
static TraceReplayRequest from(Intent intent, File filesDir, String defaultBackend) {
|
||||
static TraceReplayRequest from(Intent intent, File filesDir, String nativeLibraryDir, String defaultBackend) {
|
||||
String outputDir = readString(intent, "output_dir", new File(filesDir, "trace-replay").getAbsolutePath());
|
||||
String diffPath = readString(intent, "diff_path", "");
|
||||
return new TraceReplayRequest(
|
||||
@@ -219,6 +225,7 @@ public final class TraceReplayActivity extends Activity {
|
||||
intent.getIntExtra("crop_width", 0),
|
||||
intent.getIntExtra("crop_height", 0),
|
||||
intent.getIntExtra("fuzz_percent", 20),
|
||||
readString(intent, "angle_library_dir", nativeLibraryDir),
|
||||
intent.getBooleanExtra("use_angle", false)
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user