Skip to content

v2.0 API Revision List

Hermet Park edited this page Jul 22, 2026 · 2 revisions

WebCanvas API Revision Candidates

  • Align with ThorVG native conventions (naming + signature) as far as practical, while keeping a coherent/convenient JS API surface.

0. Canvas

JS API C API Revision
clear() None Need a practical user scenario. Otherwise remove it.

1. Scene — Effects

JS API C API Revision
resetEffects() _tvg_scene_clear_effects add(SceneEffect.Clear)
fillEffect(r,g,b,a) _tvg_scene_add_effect_fill add(SceneEffect.Fill, r,g,b,a)
gaussianBlur(...) _tvg_scene_add_effect_gaussian_blur add(SceneEffect.GaussianBlur, ...)
dropShadow(...) _tvg_scene_add_effect_drop_shadow add(SceneEffect.DropShadow, ...)
tint(...) _tvg_scene_add_effect_tint add(SceneEffect.Tint, ...)
tritone(...) _tvg_scene_add_effect_tritone add(SceneEffect.Tritone, ...)

2. Animation — Loop & Time

JS API C API Revision
setLoop(bool) none (JS-only) loop(value)
getLoop() none (JS-only) loop()
getCurrentTime() none (JS-only) currentTime()

3. Animation — Info

JS API C API Revision
info() _tvg_animation_get_total_frame, _tvg_animation_get_duration totalFrame(), duration(), fps()

4. Fill (Gradient) — Stops

JS API C API Revision
setStops(...stops) _tvg_gradient_set_color_stops colorStops(stops)
clearStops() _tvg_gradient_set_color_stops colorStops([])
build() none (JS-only) Remove
addStop(offset, color) none (JS-only) Remove
(missing) _tvg_gradient_get_color_stops colorStops()

5. Text — Size

JS API C API Revision
fontSize(size) _tvg_text_set_size size(size)

Clone this wiki locally