sw_engine: code clean up

This commit is contained in:
Hermet Park 2024-05-23 17:39:18 +09:00 committed by Hermet Park
parent 975907731d
commit efe770c3af

View file

@ -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<AALine*>(calloc(height, sizeof(AALine)));
aaSpans->lines = static_cast<AALine*>(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)
{