Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 6045e6e

Browse files
Compile skwasm with better space saving flags. (#40093)
Compile skwasm with better space saving flags.
1 parent 0aa6578 commit 6045e6e

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

lib/web_ui/skwasm/BUILD.gn

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ wasm_lib("skwasm") {
2626
"-sPTHREAD_POOL_SIZE=1",
2727
"-sALLOW_MEMORY_GROWTH",
2828
"-sUSE_PTHREADS=1",
29+
"-lexports.js",
2930
]
3031

3132
cflags = [ "-pthread" ]
@@ -40,8 +41,8 @@ wasm_lib("skwasm") {
4041
]
4142
} else {
4243
ldflags += [
43-
"-O1",
44-
"--closure=0",
44+
"-Oz",
45+
"--closure=1",
4546
"-flto",
4647
"-sEXPORTED_FUNCTIONS=[stackAlloc]",
4748
]

lib/web_ui/skwasm/helpers.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,8 @@ inline SkMatrix createMatrix(const SkScalar* f) {
1515
}
1616

1717
inline SkRRect createRRect(const SkScalar* f) {
18-
const SkScalar* twelveFloats = reinterpret_cast<const SkScalar*>(f);
19-
const SkRect* rect = reinterpret_cast<const SkRect*>(twelveFloats);
20-
const SkVector* radiiValues =
21-
reinterpret_cast<const SkVector*>(twelveFloats + 4);
18+
const SkRect* rect = reinterpret_cast<const SkRect*>(f);
19+
const SkVector* radiiValues = reinterpret_cast<const SkVector*>(f + 4);
2220

2321
SkRRect rr;
2422
rr.setRectRadii(*rect, radiiValues);

0 commit comments

Comments
 (0)