mirror of
https://github.com/penpot/penpot.git
synced 2025-01-06 14:50:20 -05:00
modify stress test (rs) to record video
This commit is contained in:
parent
f5acfd0787
commit
b36c8cd52a
3 changed files with 95 additions and 150 deletions
|
@ -241,10 +241,10 @@ pub unsafe extern "C" fn draw_shapes(
|
|||
// create a `Vec<Rect>` from the pointer to the linear memory and length
|
||||
let buf = Vec::<Rect>::from_raw_parts(ptr, len, len);
|
||||
|
||||
let mut text_paint = skia::Paint::default();
|
||||
text_paint.set_anti_alias(true);
|
||||
text_paint.set_style(skia_safe::paint::Style::StrokeAndFill);
|
||||
text_paint.set_stroke_width(1.0);
|
||||
// let mut text_paint = skia::Paint::default();
|
||||
// text_paint.set_anti_alias(true);
|
||||
// text_paint.set_style(skia_safe::paint::Style::StrokeAndFill);
|
||||
// text_paint.set_stroke_width(1.0);
|
||||
|
||||
// let mut path_paint = skia::Paint::default();
|
||||
// path_paint.set_color(skia_safe::Color::BLACK);
|
||||
|
@ -279,13 +279,13 @@ pub unsafe extern "C" fn draw_shapes(
|
|||
|
||||
// paint.set_anti_alias(true);
|
||||
// state.surface.canvas().draw_rect(r, &paint);
|
||||
state.surface.canvas().draw_text_align(
|
||||
String::from("Lorem ipsum"),
|
||||
(rect.left, rect.top),
|
||||
&state.default_font,
|
||||
&paint,
|
||||
skia::utils::text_utils::Align::Left,
|
||||
);
|
||||
// state.surface.canvas().draw_text_align(
|
||||
// String::from("Lorem ipsum"),
|
||||
// (rect.left, rect.top),
|
||||
// &state.default_font,
|
||||
// &paint,
|
||||
// skia::utils::text_utils::Align::Left,
|
||||
// );
|
||||
|
||||
// let mut paint = skia::Paint::default();
|
||||
// paint.set_style(skia::PaintStyle::Fill);
|
||||
|
|
|
@ -61,7 +61,7 @@
|
|||
[vbox zoom]
|
||||
(let [alloc-rects (gobj/get ^js internal-module "_alloc_rects")
|
||||
free_rects (gobj/get ^js internal-module "_free_rects")
|
||||
shape-count 5548
|
||||
shape-count 10000
|
||||
heap (gobj/get ^js internal-module "HEAPF32")
|
||||
;; Each F32 are 4 bytes
|
||||
;; Each rect has:
|
||||
|
@ -83,9 +83,9 @@
|
|||
y2 (+ y1 (rand-int 256))]
|
||||
(set! shapes-ptr ptr)
|
||||
(set! shapes-size shape-count)
|
||||
(.set mem (js/Float32Array. (clj->js [0 0 64 64 255 0 0 1])))
|
||||
;; (.set mem (js/Float32Array. (clj->js [0 0 64 64 255 0 0 1])))
|
||||
;; (.set mem (js/Float32Array. (clj->js [(* index 72) 0 (+ (* index 72) 64) 64 255 0 0 1])))
|
||||
;; (.set mem (js/Float32Array. (clj->js [x1 y1 x2 y2 (rand-int 255) (rand-int 255) (rand-int 255) 1])))
|
||||
(.set mem (js/Float32Array. (clj->js [x1 y1 x2 y2 (rand-int 255) (rand-int 255) (rand-int 255) 1])))
|
||||
)))
|
||||
(draw-canvas vbox zoom nil)))
|
||||
|
||||
|
|
|
@ -45,10 +45,6 @@ var ENVIRONMENT_IS_WORKER = false;
|
|||
var ENVIRONMENT_IS_NODE = false;
|
||||
var ENVIRONMENT_IS_SHELL = false;
|
||||
|
||||
if (Module['ENVIRONMENT']) {
|
||||
throw new Error('Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)');
|
||||
}
|
||||
|
||||
// --pre-jses are emitted after the Module integration code, so that they can
|
||||
// refer to Module (if they choose; they can also define Module)
|
||||
|
||||
|
@ -321,11 +317,10 @@ var __ATPOSTRUN__ = []; // functions called after the main() is called
|
|||
var runtimeInitialized = false;
|
||||
|
||||
function preRun() {
|
||||
if (Module['preRun']) {
|
||||
if (typeof Module['preRun'] == 'function') Module['preRun'] = [Module['preRun']];
|
||||
while (Module['preRun'].length) {
|
||||
addOnPreRun(Module['preRun'].shift());
|
||||
}
|
||||
var preRuns = Module['preRun'];
|
||||
if (preRuns) {
|
||||
if (typeof preRuns == 'function') preRuns = [preRuns];
|
||||
preRuns.forEach(addOnPreRun);
|
||||
}
|
||||
callRuntimeCallbacks(__ATPRERUN__);
|
||||
}
|
||||
|
@ -354,11 +349,10 @@ function preMain() {
|
|||
function postRun() {
|
||||
checkStackCookie();
|
||||
|
||||
if (Module['postRun']) {
|
||||
if (typeof Module['postRun'] == 'function') Module['postRun'] = [Module['postRun']];
|
||||
while (Module['postRun'].length) {
|
||||
addOnPostRun(Module['postRun'].shift());
|
||||
}
|
||||
var postRuns = Module['postRun'];
|
||||
if (postRuns) {
|
||||
if (typeof postRuns == 'function') postRuns = [postRuns];
|
||||
postRuns.forEach(addOnPostRun);
|
||||
}
|
||||
|
||||
callRuntimeCallbacks(__ATPOSTRUN__);
|
||||
|
@ -720,6 +714,10 @@ var tempI64;
|
|||
if (h8[0] !== 0x73 || h8[1] !== 0x63) throw 'Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)';
|
||||
})();
|
||||
|
||||
if (Module['ENVIRONMENT']) {
|
||||
throw new Error('Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)');
|
||||
}
|
||||
|
||||
function legacyModuleProp(prop, newName, incoming=true) {
|
||||
if (!Object.getOwnPropertyDescriptor(Module, prop)) {
|
||||
Object.defineProperty(Module, prop, {
|
||||
|
@ -758,15 +756,13 @@ function isExportedByForceFilesystem(name) {
|
|||
* their build, or no symbols that no longer exist.
|
||||
*/
|
||||
function hookGlobalSymbolAccess(sym, func) {
|
||||
if (typeof globalThis != 'undefined' && !Object.getOwnPropertyDescriptor(globalThis, sym)) {
|
||||
Object.defineProperty(globalThis, sym, {
|
||||
configurable: true,
|
||||
get() {
|
||||
func();
|
||||
return undefined;
|
||||
}
|
||||
});
|
||||
}
|
||||
// In MODULARIZE mode the generated code runs inside a function scope and not
|
||||
// the global scope, and JavaScript does not provide access to function scopes
|
||||
// so we cannot dynamically modify the scrope using `defineProperty` in this
|
||||
// case.
|
||||
//
|
||||
// In this mode we simply ignore requests for `hookGlobalSymbolAccess`. Since
|
||||
// this is a debug-only feature, skipping it is not major issue.
|
||||
}
|
||||
|
||||
function missingGlobal(sym, msg) {
|
||||
|
@ -836,10 +832,8 @@ function dbg(...args) {
|
|||
}
|
||||
|
||||
var callRuntimeCallbacks = (callbacks) => {
|
||||
while (callbacks.length > 0) {
|
||||
// Pass the module as the first argument.
|
||||
callbacks.shift()(Module);
|
||||
}
|
||||
// Pass the module as the first argument.
|
||||
callbacks.forEach((f) => f(Module));
|
||||
};
|
||||
|
||||
|
||||
|
@ -911,18 +905,18 @@ function dbg(...args) {
|
|||
* array that contains uint8 values, returns a copy of that string as a
|
||||
* Javascript String object.
|
||||
* heapOrArray is either a regular array, or a JavaScript typed array view.
|
||||
* @param {number} idx
|
||||
* @param {number=} idx
|
||||
* @param {number=} maxBytesToRead
|
||||
* @return {string}
|
||||
*/
|
||||
var UTF8ArrayToString = (heapOrArray, idx, maxBytesToRead) => {
|
||||
var UTF8ArrayToString = (heapOrArray, idx = 0, maxBytesToRead = NaN) => {
|
||||
var endIdx = idx + maxBytesToRead;
|
||||
var endPtr = idx;
|
||||
// TextDecoder needs to know the byte length in advance, it doesn't stop on
|
||||
// null terminator by itself. Also, use the length info to avoid running tiny
|
||||
// strings through TextDecoder, since .subarray() allocates garbage.
|
||||
// (As a tiny code save trick, compare endPtr against endIdx using a negation,
|
||||
// so that undefined means Infinity)
|
||||
// so that undefined/NaN means Infinity)
|
||||
while (heapOrArray[endPtr] && !(endPtr >= endIdx)) ++endPtr;
|
||||
|
||||
if (endPtr - idx > 16 && heapOrArray.buffer && UTF8Decoder) {
|
||||
|
@ -1493,7 +1487,7 @@ function dbg(...args) {
|
|||
},
|
||||
put_char(tty, val) {
|
||||
if (val === null || val === 10) {
|
||||
out(UTF8ArrayToString(tty.output, 0));
|
||||
out(UTF8ArrayToString(tty.output));
|
||||
tty.output = [];
|
||||
} else {
|
||||
if (val != 0) tty.output.push(val); // val == 0 would cut text output off in the middle.
|
||||
|
@ -1501,7 +1495,7 @@ function dbg(...args) {
|
|||
},
|
||||
fsync(tty) {
|
||||
if (tty.output && tty.output.length > 0) {
|
||||
out(UTF8ArrayToString(tty.output, 0));
|
||||
out(UTF8ArrayToString(tty.output));
|
||||
tty.output = [];
|
||||
}
|
||||
},
|
||||
|
@ -1530,7 +1524,7 @@ function dbg(...args) {
|
|||
default_tty1_ops:{
|
||||
put_char(tty, val) {
|
||||
if (val === null || val === 10) {
|
||||
err(UTF8ArrayToString(tty.output, 0));
|
||||
err(UTF8ArrayToString(tty.output));
|
||||
tty.output = [];
|
||||
} else {
|
||||
if (val != 0) tty.output.push(val);
|
||||
|
@ -1538,7 +1532,7 @@ function dbg(...args) {
|
|||
},
|
||||
fsync(tty) {
|
||||
if (tty.output && tty.output.length > 0) {
|
||||
err(UTF8ArrayToString(tty.output, 0));
|
||||
err(UTF8ArrayToString(tty.output));
|
||||
tty.output = [];
|
||||
}
|
||||
},
|
||||
|
@ -1548,7 +1542,6 @@ function dbg(...args) {
|
|||
|
||||
var zeroMemory = (address, size) => {
|
||||
HEAPU8.fill(0, address, address + size);
|
||||
return address;
|
||||
};
|
||||
|
||||
var alignMemory = (size, alignment) => {
|
||||
|
@ -1558,8 +1551,8 @@ function dbg(...args) {
|
|||
var mmapAlloc = (size) => {
|
||||
size = alignMemory(size, 65536);
|
||||
var ptr = _emscripten_builtin_memalign(65536, size);
|
||||
if (!ptr) return 0;
|
||||
return zeroMemory(ptr, size);
|
||||
if (ptr) zeroMemory(ptr, size);
|
||||
return ptr;
|
||||
};
|
||||
var MEMFS = {
|
||||
ops_table:null,
|
||||
|
@ -3211,7 +3204,7 @@ function dbg(...args) {
|
|||
var buf = new Uint8Array(length);
|
||||
FS.read(stream, buf, 0, length, 0);
|
||||
if (opts.encoding === 'utf8') {
|
||||
ret = UTF8ArrayToString(buf, 0);
|
||||
ret = UTF8ArrayToString(buf);
|
||||
} else if (opts.encoding === 'binary') {
|
||||
ret = buf;
|
||||
}
|
||||
|
@ -8842,16 +8835,12 @@ var wasmImports = {
|
|||
/** @export */
|
||||
invoke_ii,
|
||||
/** @export */
|
||||
invoke_iif,
|
||||
/** @export */
|
||||
invoke_iiff,
|
||||
/** @export */
|
||||
invoke_iii,
|
||||
/** @export */
|
||||
invoke_iiii,
|
||||
/** @export */
|
||||
invoke_iiiiffiii,
|
||||
/** @export */
|
||||
invoke_iiiii,
|
||||
/** @export */
|
||||
invoke_iiiiid,
|
||||
|
@ -8880,8 +8869,6 @@ var wasmImports = {
|
|||
/** @export */
|
||||
invoke_viffff,
|
||||
/** @export */
|
||||
invoke_viffi,
|
||||
/** @export */
|
||||
invoke_vifi,
|
||||
/** @export */
|
||||
invoke_vii,
|
||||
|
@ -8892,8 +8879,6 @@ var wasmImports = {
|
|||
/** @export */
|
||||
invoke_viiii,
|
||||
/** @export */
|
||||
invoke_viiiiffiii,
|
||||
/** @export */
|
||||
invoke_viiiii,
|
||||
/** @export */
|
||||
invoke_viiiiii,
|
||||
|
@ -8965,21 +8950,10 @@ var dynCall_iiiiij = Module['dynCall_iiiiij'] = createExportWrapper('dynCall_iii
|
|||
var dynCall_iiiiijj = Module['dynCall_iiiiijj'] = createExportWrapper('dynCall_iiiiijj', 9);
|
||||
var dynCall_iiiiiijj = Module['dynCall_iiiiiijj'] = createExportWrapper('dynCall_iiiiiijj', 10);
|
||||
|
||||
function invoke_vii(index,a1,a2) {
|
||||
function invoke_iii(index,a1,a2) {
|
||||
var sp = stackSave();
|
||||
try {
|
||||
getWasmTableEntry(index)(a1,a2);
|
||||
} catch(e) {
|
||||
stackRestore(sp);
|
||||
if (!(e instanceof EmscriptenEH)) throw e;
|
||||
_setThrew(1, 0);
|
||||
}
|
||||
}
|
||||
|
||||
function invoke_iiiii(index,a1,a2,a3,a4) {
|
||||
var sp = stackSave();
|
||||
try {
|
||||
return getWasmTableEntry(index)(a1,a2,a3,a4);
|
||||
return getWasmTableEntry(index)(a1,a2);
|
||||
} catch(e) {
|
||||
stackRestore(sp);
|
||||
if (!(e instanceof EmscriptenEH)) throw e;
|
||||
|
@ -9031,10 +9005,10 @@ function invoke_viii(index,a1,a2,a3) {
|
|||
}
|
||||
}
|
||||
|
||||
function invoke_iii(index,a1,a2) {
|
||||
function invoke_vifi(index,a1,a2,a3) {
|
||||
var sp = stackSave();
|
||||
try {
|
||||
return getWasmTableEntry(index)(a1,a2);
|
||||
getWasmTableEntry(index)(a1,a2,a3);
|
||||
} catch(e) {
|
||||
stackRestore(sp);
|
||||
if (!(e instanceof EmscriptenEH)) throw e;
|
||||
|
@ -9042,10 +9016,21 @@ function invoke_iii(index,a1,a2) {
|
|||
}
|
||||
}
|
||||
|
||||
function invoke_iiiiiii(index,a1,a2,a3,a4,a5,a6) {
|
||||
function invoke_vii(index,a1,a2) {
|
||||
var sp = stackSave();
|
||||
try {
|
||||
return getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6);
|
||||
getWasmTableEntry(index)(a1,a2);
|
||||
} catch(e) {
|
||||
stackRestore(sp);
|
||||
if (!(e instanceof EmscriptenEH)) throw e;
|
||||
_setThrew(1, 0);
|
||||
}
|
||||
}
|
||||
|
||||
function invoke_viiii(index,a1,a2,a3,a4) {
|
||||
var sp = stackSave();
|
||||
try {
|
||||
getWasmTableEntry(index)(a1,a2,a3,a4);
|
||||
} catch(e) {
|
||||
stackRestore(sp);
|
||||
if (!(e instanceof EmscriptenEH)) throw e;
|
||||
|
@ -9064,6 +9049,17 @@ function invoke_iiii(index,a1,a2,a3) {
|
|||
}
|
||||
}
|
||||
|
||||
function invoke_iiiiiii(index,a1,a2,a3,a4,a5,a6) {
|
||||
var sp = stackSave();
|
||||
try {
|
||||
return getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6);
|
||||
} catch(e) {
|
||||
stackRestore(sp);
|
||||
if (!(e instanceof EmscriptenEH)) throw e;
|
||||
_setThrew(1, 0);
|
||||
}
|
||||
}
|
||||
|
||||
function invoke_i(index) {
|
||||
var sp = stackSave();
|
||||
try {
|
||||
|
@ -9086,6 +9082,17 @@ function invoke_iiiiii(index,a1,a2,a3,a4,a5) {
|
|||
}
|
||||
}
|
||||
|
||||
function invoke_iiiii(index,a1,a2,a3,a4) {
|
||||
var sp = stackSave();
|
||||
try {
|
||||
return getWasmTableEntry(index)(a1,a2,a3,a4);
|
||||
} catch(e) {
|
||||
stackRestore(sp);
|
||||
if (!(e instanceof EmscriptenEH)) throw e;
|
||||
_setThrew(1, 0);
|
||||
}
|
||||
}
|
||||
|
||||
function invoke_viif(index,a1,a2,a3) {
|
||||
var sp = stackSave();
|
||||
try {
|
||||
|
@ -9119,72 +9126,6 @@ function invoke_iiff(index,a1,a2,a3) {
|
|||
}
|
||||
}
|
||||
|
||||
function invoke_viiii(index,a1,a2,a3,a4) {
|
||||
var sp = stackSave();
|
||||
try {
|
||||
getWasmTableEntry(index)(a1,a2,a3,a4);
|
||||
} catch(e) {
|
||||
stackRestore(sp);
|
||||
if (!(e instanceof EmscriptenEH)) throw e;
|
||||
_setThrew(1, 0);
|
||||
}
|
||||
}
|
||||
|
||||
function invoke_iif(index,a1,a2) {
|
||||
var sp = stackSave();
|
||||
try {
|
||||
return getWasmTableEntry(index)(a1,a2);
|
||||
} catch(e) {
|
||||
stackRestore(sp);
|
||||
if (!(e instanceof EmscriptenEH)) throw e;
|
||||
_setThrew(1, 0);
|
||||
}
|
||||
}
|
||||
|
||||
function invoke_iiiiffiii(index,a1,a2,a3,a4,a5,a6,a7,a8) {
|
||||
var sp = stackSave();
|
||||
try {
|
||||
return getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7,a8);
|
||||
} catch(e) {
|
||||
stackRestore(sp);
|
||||
if (!(e instanceof EmscriptenEH)) throw e;
|
||||
_setThrew(1, 0);
|
||||
}
|
||||
}
|
||||
|
||||
function invoke_viffi(index,a1,a2,a3,a4) {
|
||||
var sp = stackSave();
|
||||
try {
|
||||
getWasmTableEntry(index)(a1,a2,a3,a4);
|
||||
} catch(e) {
|
||||
stackRestore(sp);
|
||||
if (!(e instanceof EmscriptenEH)) throw e;
|
||||
_setThrew(1, 0);
|
||||
}
|
||||
}
|
||||
|
||||
function invoke_viiiiffiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9) {
|
||||
var sp = stackSave();
|
||||
try {
|
||||
getWasmTableEntry(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9);
|
||||
} catch(e) {
|
||||
stackRestore(sp);
|
||||
if (!(e instanceof EmscriptenEH)) throw e;
|
||||
_setThrew(1, 0);
|
||||
}
|
||||
}
|
||||
|
||||
function invoke_vifi(index,a1,a2,a3) {
|
||||
var sp = stackSave();
|
||||
try {
|
||||
getWasmTableEntry(index)(a1,a2,a3);
|
||||
} catch(e) {
|
||||
stackRestore(sp);
|
||||
if (!(e instanceof EmscriptenEH)) throw e;
|
||||
_setThrew(1, 0);
|
||||
}
|
||||
}
|
||||
|
||||
function invoke_viiiiii(index,a1,a2,a3,a4,a5,a6) {
|
||||
var sp = stackSave();
|
||||
try {
|
||||
|
@ -9661,6 +9602,7 @@ unexportedSymbols.forEach(unexportedRuntimeSymbol);
|
|||
|
||||
|
||||
var calledRun;
|
||||
var calledPrerun;
|
||||
|
||||
dependenciesFulfilled = function runCaller() {
|
||||
// If run has never been called, and we should call run (INVOKE_RUN is true, and Module.noInitialRun is not false)
|
||||
|
@ -9670,7 +9612,7 @@ dependenciesFulfilled = function runCaller() {
|
|||
|
||||
function callMain(args = []) {
|
||||
assert(runDependencies == 0, 'cannot call main when async dependencies remain! (listen on Module["onRuntimeInitialized"])');
|
||||
assert(__ATPRERUN__.length == 0, 'cannot call main when preRun functions remain to be called');
|
||||
assert(calledPrerun, 'cannot call main without calling preRun first');
|
||||
|
||||
var entryFunction = _main;
|
||||
|
||||
|
@ -9715,19 +9657,22 @@ function run(args = arguments_) {
|
|||
|
||||
stackCheckInit();
|
||||
|
||||
preRun();
|
||||
if (!calledPrerun) {
|
||||
calledPrerun = 1;
|
||||
preRun();
|
||||
|
||||
// a preRun added a dependency, run will be called later
|
||||
if (runDependencies > 0) {
|
||||
return;
|
||||
// a preRun added a dependency, run will be called later
|
||||
if (runDependencies > 0) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
function doRun() {
|
||||
// run may have just been called through dependencies being fulfilled just in this very frame,
|
||||
// or while the async setStatus time below was happening
|
||||
if (calledRun) return;
|
||||
calledRun = true;
|
||||
Module['calledRun'] = true;
|
||||
calledRun = 1;
|
||||
Module['calledRun'] = 1;
|
||||
|
||||
if (ABORT) return;
|
||||
|
||||
|
|
Loading…
Reference in a new issue