]> O.S.I.I.S - jp/vkvg.git/commitdiff
comments
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Thu, 26 May 2022 11:57:20 +0000 (13:57 +0200)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Thu, 26 May 2022 11:57:20 +0000 (13:57 +0200)
src/vkvg_context_internal.c

index 95f4a940b0a04edbb464a29c22bd8fcc6755aba6..c6a7244e81e36368a16e7f8ed4b5364efea324bc 100644 (file)
@@ -177,9 +177,10 @@ void _finish_path (VkvgContext ctx){
        if (ctx->pathPtr == 0 && ctx->simpleConvex)
                ctx->pathes[0] |= PATH_IS_CONVEX_BIT;
 
-       if (ctx->segmentPtr > 0) {
+       if (ctx->segmentPtr > 0) {//pathes having curves are segmented
                ctx->pathes[ctx->pathPtr] |= PATH_HAS_CURVES_BIT;
-               //if last segment is not a curve and point count > 0
+               //curved segment increment segmentPtr on curve end,
+               //so if last segment is not a curve and point count > 0
                if ((ctx->pathes[ctx->pathPtr+ctx->segmentPtr]&PATH_HAS_CURVES_BIT)==0 &&
                                (ctx->pathes[ctx->pathPtr+ctx->segmentPtr]&PATH_ELT_MASK) > 0)
                        ctx->segmentPtr++;//current segment has to be included
@@ -520,6 +521,7 @@ void _flush_vertices_caches_until_vertex_base (VkvgContext ctx) {
        memcpy(ctx->indices.allocInfo.pMappedData, ctx->indexCache, ctx->curIndStart * sizeof (VKVG_IBO_INDEX_TYPE));
 
        //copy remaining vertices and indices to caches starts
+       //this could be optimized at the cost of additional offsets.
        ctx->vertCount -= ctx->curVertOffset;
        ctx->indCount -= ctx->curIndStart;
        memcpy(ctx->vertexCache, &ctx->vertexCache[ctx->curVertOffset], ctx->vertCount * sizeof (Vertex));