diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2026-09-16 13:27:39 +0200 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2026-09-24 03:57:50 +0200 |
| commit | 9ae2c53499ac860410471cec9a66b6a25f1966e5 (patch) | |
| tree | 8f1f261281799a7a9079dbb9d8df8ff09314e563 | |
| parent | 97c0ae8c7809641cdd3593f89fa820089ce636d8 (diff) | |
_update_cur_pattern: don't set pattern with status not ok
| -rw-r--r-- | src/cross_os.c | 24 | ||||
| -rw-r--r-- | src/vkvg_context_internal.c | 9 | ||||
| -rw-r--r-- | src/vkvg_device_internal.c | 2 |
3 files changed, 9 insertions, 26 deletions
diff --git a/src/cross_os.c b/src/cross_os.c index b6e0ebb..bd8d3df 100644 --- a/src/cross_os.c +++ b/src/cross_os.c @@ -1,24 +1,6 @@ -/* - * Copyright (c) 2018-2022 Jean-Philippe Bruyère <jp_bruyere@hotmail.com> - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the - * Software, and to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ +// Copyright (c) 2018-2026 Jean-Philippe Bruyère <jp_bruyere@hotmail.com> +// +// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) #include "cross_os.h" #include <sys/types.h> #include <sys/stat.h> diff --git a/src/vkvg_context_internal.c b/src/vkvg_context_internal.c index aeb61bd..80f29a1 100644 --- a/src/vkvg_context_internal.c +++ b/src/vkvg_context_internal.c @@ -681,18 +681,19 @@ void _update_push_constants(VkvgContext ctx) { } void _update_cur_pattern(VkvgContext ctx, VkvgPattern pat) { VkvgPattern lastPat = ctx->pattern; - ctx->pattern = pat; - uint32_t newPatternType = VKVG_PATTERN_TYPE_SOLID; - LOG(VKVG_LOG_INFO, "CTX: _update_cur_pattern: %p -> %p\n", lastPat, pat); - if (pat == NULL) { // solid color if (lastPat == NULL) // solid return; // solid to solid transition, no extra action requested + } else if (pat->status) { + LOG(VKVG_LOG_ERR, "Error: Update pattern fails, pattern status: %d\n", pat->status); + return; } else newPatternType = pat->type; + ctx->pattern = pat; + switch (newPatternType) { case VKVG_PATTERN_TYPE_SOLID: _flush_cmd_buff(ctx); diff --git a/src/vkvg_device_internal.c b/src/vkvg_device_internal.c index 3935d98..a86715f 100644 --- a/src/vkvg_device_internal.c +++ b/src/vkvg_device_internal.c @@ -557,7 +557,7 @@ void _device_check_best_image_tiling(VkvgDevice dev, VkFormat format) { } if (dev->pngStagFormat == VK_FORMAT_UNDEFINED) - LOG(VKVG_LOG_DEBUG, "vkvg create device failed: no suitable image format for png write\n"); + LOG(VKVG_LOG_DEBUG, "vkvg create device warning: no suitable image format for png write\n"); dev->stencilFormat = VK_FORMAT_UNDEFINED; dev->stencilAspectFlag = VK_IMAGE_ASPECT_STENCIL_BIT; |