summaryrefslogtreecommitdiffstatsci
path: root/src
diff options
context:
space:
mode:
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>2021-12-30 09:54:41 +0100
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>2021-12-30 09:54:41 +0100
commitd7d28a409b2cb3c5af019887a4cf30624f16efd9 (patch)
tree437ae23be056ad2a5a2387d6e5e66425b015f317 /src
parent0de28aa2782bbaf15fc53333d30c509b8d3f1e3a (diff)
add missing vkvg_status()
Diffstat (limited to 'src')
-rw-r--r--src/vkvg_context.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/vkvg_context.c b/src/vkvg_context.c
index de719d4..c056bdf 100644
--- a/src/vkvg_context.c
+++ b/src/vkvg_context.c
@@ -286,6 +286,9 @@ void vkvg_destroy (VkvgContext ctx)
free(ctx);
}
+vkvg_status_t vkvg_status (VkvgContext ctx) {
+ return ctx->status;
+}
VkvgContext vkvg_reference (VkvgContext ctx) {
ctx->references++;
return ctx;
@@ -526,15 +529,13 @@ void vkvg_fill_rectangle (VkvgContext ctx, float x, float y, float w, float h){
//_record_draw_cmd(ctx);
}
-void vkvg_rectangle (VkvgContext ctx, float x, float y, float w, float h){
+vkvg_status_t vkvg_rectangle (VkvgContext ctx, float x, float y, float w, float h){
if (ctx->status)
- return;
+ return ctx->status;
_finish_path (ctx);
- if (w <= 0 || h <= 0) {
- ctx->status = VKVG_STATUS_INVALID_RECT;
- return;
- }
+ if (w <= 0 || h <= 0)
+ return VKVG_STATUS_INVALID_RECT;
_add_point (ctx, x, y);
_add_point (ctx, x + w, y);
@@ -544,6 +545,7 @@ void vkvg_rectangle (VkvgContext ctx, float x, float y, float w, float h){
ctx->pathes[ctx->pathPtr] |= PATH_CLOSED_BIT;
_finish_path(ctx);
+ return VKVG_STATUS_SUCCESS;
}
static const VkClearAttachment clearStencil = {VK_IMAGE_ASPECT_STENCIL_BIT, 1, {{{0}}}};
static const VkClearAttachment clearColorAttach = {VK_IMAGE_ASPECT_COLOR_BIT, 0, {{{0}}}};