Draw functions
This section provides an overview of the draw functions.
vg_lite_draw
function
Description:
This function performs a hardware accelerated 2D vector draw operation.
The size of the tessellation buffer can be specified at initialization and it is aligned with the minimum hardware alignment requirements of the kernel. Specifying a smaller size for tessellation buffer allocates less memory but reduces performance. Because the hardware walks the target with the provided tessellation window size, a path may be sent to the hardware multiple times. It is a good practice to set the tessellation buffer size to the most common path size. For example, if all you do is render up to 24-point fonts, you can set the tessellation buffer to 24x24.
Note:
All the color formats available in the vg_lite_buffer_format_t enum are supported as the destination buffer for the draw function
The hardware does not support strokes; they must be converted to paths before you use them in the draw API
Syntax:
vg_lite_error_t vg_lite_draw (
vg_lite_buffer_t *target,
vg_lite_path_t *path,
vg_lite_fill_t fill_rule,
vg_lite_matrix_t *matrix,
vg_lite_blend_t blend,
vg_lite_color_t color
);
Parameters:
Parameter |
Description |
---|---|
|
Pointer to the |
|
Pointer to the |
|
Specifies the |
|
Pointer to a |
|
Select one of the hardware-supported blend modes in the |
|
The color applied to each pixel drawn by the path. |
Returns:
Returns VG_LITE_SUCCESS
if successful. See vg_lite_error_t enum for other return codes.
Parent topic:Draw functions
vg_lite_draw_grad function
Description:
This function is used to fill a path with a linear gradient according to the specified fill rules. The specified path is transformed according to the selected matrix and is filled with the specified color gradient.
Syntax:
vg_lite_error_t vg_lite_draw_grad (
vg_lite_buffer_t *target,
vg_lite_path_t *path,
vg_lite_fill_t fill_rule,
vg_lite_matrix_t *matrix,
vg_lite_linear_gradient_t *grad,
vg_lite_blend_t blend
);
Parameters:
Parameter |
Description |
---|---|
|
Pointer to the |
|
Pointer to the |
|
Specifies the |
|
Pointer to the |
|
Pointer to the |
|
Specifies the blend mode in the |
Returns:
Returns VG_LITE_SUCCESS
if successful. See vg_lite_error_t enum for other return codes.
Parent topic:Draw functions
vg_lite_draw_radial_grad function
Description:
This function is used to fill a path with a radial gradient according to the specified fill rules. The specified path is transformed according to the selected matrix and is filled with the radial color gradient. The application can use VGLite API vg_lite_query_feature
(gcFEATURE_BIT_VG_RADIAL_GRADIENT
) to determine HW support for radial gradient.
Syntax:
vg_lite_error_t vg_lite_draw_radial_grad (
vg_lite_buffer_t *target,
vg_lite_path_t *path,
vg_lite_fill_t fill_rule,
vg_lite_matrix_t *path_matrix,
vg_lite_radial_gradient_t *grad,
vg_lite_color_t paint_color,
vg_lite_blend_t blend,
vg_lite_filter_t filter
);
Parameters:
Parameter |
Description |
---|---|
|
Pointer to the |
|
Pointer to the |
|
Specifies the |
|
Pointer to a |
|
Pointer to the |
|
Specifies the paint color |
|
Specifies the blend mode in the |
|
Specified the filter mode |
Returns:
Returns VG_LITE_SUCCESS
if successful. See vg_lite_error_t enum for other return codes.
Parent topic:Draw functions
vg_lite_draw_pattern
function
Description:
This function fills a path with an image pattern. The path is transformed according to the specified matrix and is filled with the transformed image pattern.
Syntax:
vg_lite_error_t vg_lite_draw_pattern (
vg_lite_buffer_t *target,
vg_lite_path_t *path,
vg_lite_fill_t fill_rule,
vg_lite_matrix_t *path_matrix,
vg_lite_buffer_t *pattern_image,
vg_lite_matrix_t *pattern_matrix,
vg_lite_blend_t blend,
vg_lite_pattern_mode_t pattern_mode,
vg_lite_color_t pattern_color,
vg_lite_color_t color,
vg_lite_filter_t filter
);
Parameters:
Parameter |
Description |
---|---|
|
Pointer to the |
|
Pointer to the |
|
Specifies the vg_lite_fill_t enum value for the fill rule for the path. |
|
Pointer to the |
|
Pointer to a |
|
Pointer to the |
Pointer to a |
|
|
Specifies one of the |
|
Specifies the |
|
Specifies a 32bpp ARGB color ( |
|
Specifies a 32bpp ARGB color ( |
|
Specifies the filter type. All formats available in the |
Returns:
Returns VG_LITE_SUCCESS
if successful. See vg_lite_error_t enum for other return codes.
Parent topic:Draw functions
Parent topic:Vector-dased draw operations