ThorVG  v0.13
WgCanvasfinal

A class for the rendering graphic elements with a WebGPU raster engine. More...

Inheritance diagram for WgCanvas:

Public Member Functions

Result target (void *window, uint32_t w, uint32_t h) noexcept
 Sets the target window for the rasterization. More...
 
- Public Member Functions inherited from Canvas
TVG_DEPRECATED Result reserve (uint32_t n) noexcept
 Sets the size of the container, where all the paints pushed into the Canvas are stored. More...
 
std::list< Paint * > & paints () noexcept
 Returns the list of the paints that currently held by the Canvas. More...
 
virtual Result push (std::unique_ptr< Paint > paint) noexcept
 Passes drawing elements to the Canvas using Paint objects. More...
 
virtual Result clear (bool free=true) noexcept
 Clear the internal canvas resources that used for the drawing. More...
 
virtual Result update (Paint *paint=nullptr) noexcept
 Request the canvas to update the paint objects. More...
 
virtual Result draw () noexcept
 Requests the canvas to draw the Paint objects. More...
 
virtual Result sync () noexcept
 Guarantees that drawing task is finished. More...
 

Static Public Member Functions

static std::unique_ptr< WgCanvasgen () noexcept
 Creates a new WgCanvas object. More...
 

Detailed Description

A class for the rendering graphic elements with a WebGPU raster engine.

Warning
Please do not use it. This class is not fully supported yet.
Note
Experimental API

Member Function Documentation

◆ gen()

static std::unique_ptr<WgCanvas> gen ( )
staticnoexcept

Creates a new WgCanvas object.

Returns
A new WgCanvas object.
Note
Experimental API

◆ target()

Result target ( void *  window,
uint32_t  w,
uint32_t  h 
)
noexcept

Sets the target window for the rasterization.

Warning
Please do not use it, this API is not official one. It could be modified in the next version.
Note
Experimental API