Compile skwasm with better space saving flags. (flutter/engine#40093)

Compile skwasm with better space saving flags.
This commit is contained in:
Jackson Gardner
2023-03-06 14:27:48 -08:00
committed by GitHub
parent 8d28502d0f
commit b8c4597090
2 changed files with 5 additions and 6 deletions

View File

@@ -26,6 +26,7 @@ wasm_lib("skwasm") {
"-sPTHREAD_POOL_SIZE=1",
"-sALLOW_MEMORY_GROWTH",
"-sUSE_PTHREADS=1",
"-lexports.js",
]
cflags = [ "-pthread" ]
@@ -40,8 +41,8 @@ wasm_lib("skwasm") {
]
} else {
ldflags += [
"-O1",
"--closure=0",
"-Oz",
"--closure=1",
"-flto",
"-sEXPORTED_FUNCTIONS=[stackAlloc]",
]

View File

@@ -15,10 +15,8 @@ inline SkMatrix createMatrix(const SkScalar* f) {
}
inline SkRRect createRRect(const SkScalar* f) {
const SkScalar* twelveFloats = reinterpret_cast<const SkScalar*>(f);
const SkRect* rect = reinterpret_cast<const SkRect*>(twelveFloats);
const SkVector* radiiValues =
reinterpret_cast<const SkVector*>(twelveFloats + 4);
const SkRect* rect = reinterpret_cast<const SkRect*>(f);
const SkVector* radiiValues = reinterpret_cast<const SkVector*>(f + 4);
SkRRect rr;
rr.setRectRadii(*rect, radiiValues);