mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-15 12:34:30 +00:00
sw_engine: fixed declaration of 'i' shadows a previous local
Some gcc versions and configurations was giving an error: error: "declaration of 'i' shadows a previous local" This patch should fix these errors
This commit is contained in:
parent
43e5644e8b
commit
a0895cc91b
1 changed files with 12 additions and 12 deletions
|
@ -1157,12 +1157,12 @@ static bool _rasterTranslucentLinearGradientRle(SwSurface* surface, const SwRleD
|
||||||
auto dst = &surface->buffer[span->y * surface->stride + span->x];
|
auto dst = &surface->buffer[span->y * surface->stride + span->x];
|
||||||
fillFetchLinear(fill, buffer, span->y, span->x, span->len);
|
fillFetchLinear(fill, buffer, span->y, span->x, span->len);
|
||||||
if (span->coverage == 255) {
|
if (span->coverage == 255) {
|
||||||
for (uint32_t i = 0; i < span->len; ++i, ++dst) {
|
for (uint32_t x = 0; x < span->len; ++x, ++dst) {
|
||||||
*dst = buffer[i] + ALPHA_BLEND(*dst, _ialpha(buffer[i]));
|
*dst = buffer[x] + ALPHA_BLEND(*dst, _ialpha(buffer[x]));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (uint32_t i = 0; i < span->len; ++i, ++dst) {
|
for (uint32_t x = 0; x < span->len; ++x, ++dst) {
|
||||||
auto tmp = ALPHA_BLEND(buffer[i], span->coverage);
|
auto tmp = ALPHA_BLEND(buffer[x], span->coverage);
|
||||||
*dst = tmp + ALPHA_BLEND(*dst, _ialpha(tmp));
|
*dst = tmp + ALPHA_BLEND(*dst, _ialpha(tmp));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1186,8 +1186,8 @@ static bool _rasterSolidLinearGradientRle(SwSurface* surface, const SwRleData* r
|
||||||
} else {
|
} else {
|
||||||
fillFetchLinear(fill, buf, span->y, span->x, span->len);
|
fillFetchLinear(fill, buf, span->y, span->x, span->len);
|
||||||
auto dst = &surface->buffer[span->y * surface->stride + span->x];
|
auto dst = &surface->buffer[span->y * surface->stride + span->x];
|
||||||
for (uint32_t i = 0; i < span->len; ++i) {
|
for (uint32_t x = 0; x < span->len; ++x) {
|
||||||
dst[i] = INTERPOLATE(span->coverage, buf[i], dst[i]);
|
dst[x] = INTERPOLATE(span->coverage, buf[x], dst[x]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1350,12 +1350,12 @@ static bool _rasterTranslucentRadialGradientRle(SwSurface* surface, const SwRleD
|
||||||
auto dst = &surface->buffer[span->y * surface->stride + span->x];
|
auto dst = &surface->buffer[span->y * surface->stride + span->x];
|
||||||
fillFetchRadial(fill, buffer, span->y, span->x, span->len);
|
fillFetchRadial(fill, buffer, span->y, span->x, span->len);
|
||||||
if (span->coverage == 255) {
|
if (span->coverage == 255) {
|
||||||
for (uint32_t i = 0; i < span->len; ++i, ++dst) {
|
for (uint32_t x = 0; x < span->len; ++x, ++dst) {
|
||||||
*dst = buffer[i] + ALPHA_BLEND(*dst, _ialpha(buffer[i]));
|
*dst = buffer[x] + ALPHA_BLEND(*dst, _ialpha(buffer[x]));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (uint32_t i = 0; i < span->len; ++i, ++dst) {
|
for (uint32_t x = 0; x < span->len; ++x, ++dst) {
|
||||||
auto tmp = ALPHA_BLEND(buffer[i], span->coverage);
|
auto tmp = ALPHA_BLEND(buffer[x], span->coverage);
|
||||||
*dst = tmp + ALPHA_BLEND(*dst, _ialpha(tmp));
|
*dst = tmp + ALPHA_BLEND(*dst, _ialpha(tmp));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1380,8 +1380,8 @@ static bool _rasterSolidRadialGradientRle(SwSurface* surface, const SwRleData* r
|
||||||
} else {
|
} else {
|
||||||
fillFetchRadial(fill, buf, span->y, span->x, span->len);
|
fillFetchRadial(fill, buf, span->y, span->x, span->len);
|
||||||
auto ialpha = 255 - span->coverage;
|
auto ialpha = 255 - span->coverage;
|
||||||
for (uint32_t i = 0; i < span->len; ++i, ++dst) {
|
for (uint32_t x = 0; x < span->len; ++x, ++dst) {
|
||||||
*dst = ALPHA_BLEND(buf[i], span->coverage) + ALPHA_BLEND(*dst, ialpha);
|
*dst = ALPHA_BLEND(buf[x], span->coverage) + ALPHA_BLEND(*dst, ialpha);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue