I updated to Skia m104 and now stroked shapes are 1000x slower than before. FIlled shapes are fine. Stroked shapes look fine, they just take forever to draw. Even simple lines.
I don't use canvaskit, I use the libskia.a file, along with my own code.
Is there some emscriptend compile flag needed, that I am not using? Or not using correctly?
This is my shell script build line:
em++ \
-std=c++17 \
-Oz \
-fsanitize=address \
-DSK_FORCE_8_BYTE_ALIGNMENT \
-DSK_DISABLE_EFFECT_DESERIALIZATION \
-DSK_DISABLE_LEGACY_SHADERCONTEXT \
-DSKNX_NO_SIMD \
-DSK_DISABLE_AAA \
-DSK_RELEASE \
-DNDEBUG \
-DSK_ENABLE_SKSL \
-DSK_ENABLE_PRECOMPILE \
-DSK_GAMMA_APPLY_TO_A8 \
-DSK_ALLOW_STATIC_GLOBAL_INITIALIZERS=1 \
-DGR_TEST_UTILS=1 \
-DSKIA_IMPLEMENTATION=1 \
-DSK_SUPPORT_GPU=1 \
-s ASSERTIONS=1 \
-s LLD_REPORT_UNDEFINED \
-s EXPORTED_FUNCTIONS=['_malloc','_free'] \
-s FORCE_FILESYSTEM=0 \
-s FILESYSTEM=0 \
-s USE_WEBGL2=1 \
-s TOTAL_MEMORY=1024MB \
-s ALLOW_MEMORY_GROWTH=1 \
-fPIC \
-I$SKIA_DIR \
-I$SKIA_DIR/include \
-I$SKIA_DIR/include/gpu \
-I$SKIA_DIR/include/gpu/gl \
-I$SKIA_DIR/include/c \
-I$SKIA_DIR/include/config \
-I$SKIA_DIR/include/core \
-I$SKIA_DIR/include/pathops \
-I$SKIA_DIR/include/codec \
-I$SKIA_DIR/include/effects \
-I$SKIA_DIR/include/images \
-I$SKIA_DIR/include/ports \
-I$SKIA_DIR/include/private \
-I$SKIA_DIR/src/core \
-I$SKIA_DIR/src/sfnt \
-I$SKIA_DIR/src/gpu \
-I$SKIA_DIR/src/image \
-I$SKIA_DIR/include/utils \
-I$SKIA_DIR/src/utils \
-I$SKIA_DIR/include/views \
-I$SKIA_DIR/include/xml \
./mycode/foo.cpp \
$SKIA_DIR/out/canvaskit_wasm/libskia.a \
-lembind \
-lGL \
-o ./out/wasm/foo.js
I imagine that Skia is using geometry shaders for handling the stroked lines. Making triangle meshes out of them. Could there be some special flag needed to enable geometry shaders?