-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(perf): 🎸 enable thorvg multi threaded rendering #159
Conversation
|
@hermet after enabling thorvg multi threaded rendering, i'm not getting the frame buffer updated anymore and getting a blank canvas. in thorvg.rs module, i'm passing the threads count to impl Canvas {
pub fn new(engine_method: TvgEngine, threads: u32) -> Self {
let engine = match engine_method {
TvgEngine::TvgEngineSw => Tvg_Engine_TVG_ENGINE_SW,
TvgEngine::TvgEngineGl => Tvg_Engine_TVG_ENGINE_GL,
};
let init_result = unsafe { tvg_engine_init(engine, threads) };
if init_result != Tvg_Result_TVG_RESULT_SUCCESS {
panic!("Failed to initialize ThorVG engine");
}
Canvas {
raw_canvas: unsafe { tvg_swcanvas_create() },
engine_method: engine,
}
}
.... |
@theashraf What value did you use for the thread number, and which platform did you test it on? Please note that SharedArrayBuffer, required in web, would have a security issue now, the thorvg intrinsic thread feature might not be proper for the web (let me double check it) but other platforms such as android and iOS should be ok. + @tinyjin |
@theashraf Hello, Ashraf. I've only tested the native threading in web. It required enabling a few options
Of course, they're part of Emscripten flags, I'm not sure it'd help even in Android, iOS and Rust. |
Fixes #141