From efe770c3afd0a7e07a3803f70133be9fc872cc7b Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Thu, 23 May 2024 17:39:18 +0900 Subject: [PATCH] sw_engine: code clean up --- src/renderer/sw_engine/tvgSwRasterTexmap.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/renderer/sw_engine/tvgSwRasterTexmap.h b/src/renderer/sw_engine/tvgSwRasterTexmap.h index 731f6984..6d584300 100644 --- a/src/renderer/sw_engine/tvgSwRasterTexmap.h +++ b/src/renderer/sw_engine/tvgSwRasterTexmap.h @@ -833,11 +833,13 @@ static AASpans* _AASpans(float ymin, float ymax, const SwImage* image, const SwB //Initialize X range auto height = yEnd - yStart; - aaSpans->lines = static_cast(calloc(height, sizeof(AALine))); + aaSpans->lines = static_cast(malloc(height * sizeof(AALine))); for (int32_t i = 0; i < height; i++) { aaSpans->lines[i].x[0] = INT32_MAX; aaSpans->lines[i].x[1] = INT32_MIN; + aaSpans->lines[i].length[0] = 0; + aaSpans->lines[i].length[1] = 0; } return aaSpans; } @@ -885,7 +887,7 @@ static void _calcHorizCoverage(AALine *lines, int32_t eidx, int32_t y, int32_t x /* * This Anti-Aliasing mechanism is originated from Hermet Park's idea. * To understand this AA logic, you can refer this page: - * www.hermet.pe.kr/122 (hermetpark@gmail.com) + * https://uigraphics.tistory.com/1 */ static void _calcAAEdge(AASpans *aaSpans, int32_t eidx) {