The Path module contains the C part of the MicroVG implementation, which manages vector paths. This module is composed of two elements:
- an implementation of Low-Level APIs to create path elements compatible with the hardware,
- an implementation of Low-Level APIs for MicroVG drawings.
The Path module implements the framework of the MicroVG Path. It provides Low-Level APIs that create and merge some paths in a platform-specific format. After the path creation and encoding, the path data should not change when the application draws it: the encoded format should be used by the platform-specific implementation (generally GPU).
A path is a succession of commands.
The command encoding is implementation specific; however, the
float format is recommended.
List of commands:
LLVG_PATH_CMD_CLOSE: MicroVG “CLOSE” command.
LLVG_PATH_CMD_MOVE: MicroVG “MOVE ABS” command.
LLVG_PATH_CMD_MOVE_REL: MicroVG “MOVE REL” command.
LLVG_PATH_CMD_LINE: MicroVG “LINE ABS” command.
LLVG_PATH_CMD_LINE_REL: MicroVG “LINE REL” command.
LLVG_PATH_CMD_QUAD: MicroVG “QUAD ABS” command.
LLVG_PATH_CMD_QUAD_REL: MicroVG “QUAD REL” command.
LLVG_PATH_CMD_CUBIC: MicroVG “CUBIC ABS” command.
LLVG_PATH_CMD_CUBIC_REL: MicroVG “CUBIC REL” command.
The buffer where the commands are encoded is stored in the Java heap. The buffer size is automatically increased by the MicroVG implementation when no more commands can be added.
A path is drawn with a color or with a linear gradient.
There are two separate Low-Level API header files (see LLVG_PATH: Vector Path):
LLVG_PATH_impl.hspecifies the Low-Level APIs used to create and encode the path.
LLVG_PATH_PAINTER_impl.hlists the Low-Level APIs called by VectorGraphicsPainter to draw the path.
- MicroVG library calls the BSP functions through the header files
- The C module MicroVG provides a default implementation of
LLVG_PATH_impl.h: it manages the path buffer creation and filling, then redirect the command encoding to
- The C module MicroVG-VGLite provides an implementation of
microvg_path.h: it encodes the path commands and implements the drawings over the Vivante VGLite library.
- The drawer also manages the Gradient.
- These files are automatically copied in the BSP project when fetching the C modules during the platform build.