ThorVG WebCanvas API - v1.1.4
    Preparing search index...

    Type Alias RendererType

    RendererType: "sw" | "gl" | "wg"

    Rendering backend type for Canvas.

    ThorVG supports three rendering backends, each with different performance characteristics and browser compatibility:

    • Rendering: CPU-based software rendering
    • Performance: Slower, but works everywhere
    • Compatibility: All browsers and devices
    • Rendering: GPU-accelerated using WebGL 2.0
    • Performance: Excellent performance with wide browser support
    • Compatibility: Chrome 56+, Firefox 51+, Safari 15+, Edge 79+
    • Rendering: Next-generation GPU API
    • Performance: Best performance for complex scenes
    • Compatibility: Chrome 113+, Edge 113+ (limited support)
    // Recommended setup with WebGL
    const TVG = await ThorVG.init({ renderer: 'gl' });
    const canvas = new TVG.Canvas('#canvas', { width: 800, height: 600 });
    // Maximum performance with WebGPU (modern browsers only)
    const TVG = await ThorVG.init({ renderer: 'wg' });
    // Maximum compatibility with Software renderer
    const TVG = await ThorVG.init({ renderer: 'sw' });