mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 05:33:36 +00:00
sw_engine: code clean up
This commit is contained in:
parent
975907731d
commit
efe770c3af
1 changed files with 4 additions and 2 deletions
|
@ -833,11 +833,13 @@ static AASpans* _AASpans(float ymin, float ymax, const SwImage* image, const SwB
|
||||||
//Initialize X range
|
//Initialize X range
|
||||||
auto height = yEnd - yStart;
|
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++) {
|
for (int32_t i = 0; i < height; i++) {
|
||||||
aaSpans->lines[i].x[0] = INT32_MAX;
|
aaSpans->lines[i].x[0] = INT32_MAX;
|
||||||
aaSpans->lines[i].x[1] = INT32_MIN;
|
aaSpans->lines[i].x[1] = INT32_MIN;
|
||||||
|
aaSpans->lines[i].length[0] = 0;
|
||||||
|
aaSpans->lines[i].length[1] = 0;
|
||||||
}
|
}
|
||||||
return aaSpans;
|
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.
|
* This Anti-Aliasing mechanism is originated from Hermet Park's idea.
|
||||||
* To understand this AA logic, you can refer this page:
|
* 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)
|
static void _calcAAEdge(AASpans *aaSpans, int32_t eidx)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue