mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 13:43:43 +00:00
sw_engine: fix internal types of rasterXYFlip
Before the C++ compiler couldn't decide the template of std::min (that happen if `int` type is not an `int32_t`), so explicitly changing all types to int32_t fixes this.
This commit is contained in:
parent
41b340bbdb
commit
07da6c5870
1 changed files with 5 additions and 5 deletions
|
@ -1813,7 +1813,7 @@ bool rasterConvertCS(RenderSurface* surface, ColorSpace to)
|
||||||
//TODO: SIMD OPTIMIZATION?
|
//TODO: SIMD OPTIMIZATION?
|
||||||
void rasterXYFlip(uint32_t* src, uint32_t* dst, int32_t stride, int32_t w, int32_t h, const SwBBox& bbox, bool flipped)
|
void rasterXYFlip(uint32_t* src, uint32_t* dst, int32_t stride, int32_t w, int32_t h, const SwBBox& bbox, bool flipped)
|
||||||
{
|
{
|
||||||
constexpr int BLOCK = 8; //experimental decision
|
constexpr int32_t BLOCK = 8; //experimental decision
|
||||||
|
|
||||||
if (flipped) {
|
if (flipped) {
|
||||||
src += ((bbox.min.x * stride) + bbox.min.y);
|
src += ((bbox.min.x * stride) + bbox.min.y);
|
||||||
|
@ -1824,16 +1824,16 @@ void rasterXYFlip(uint32_t* src, uint32_t* dst, int32_t stride, int32_t w, int32
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma omp parallel for
|
#pragma omp parallel for
|
||||||
for (int x = 0; x < w; x += BLOCK) {
|
for (int32_t x = 0; x < w; x += BLOCK) {
|
||||||
auto bx = std::min(w, x + BLOCK) - x;
|
auto bx = std::min(w, x + BLOCK) - x;
|
||||||
auto in = &src[x];
|
auto in = &src[x];
|
||||||
auto out = &dst[x * stride];
|
auto out = &dst[x * stride];
|
||||||
for (int y = 0; y < h; y += BLOCK) {
|
for (int32_t y = 0; y < h; y += BLOCK) {
|
||||||
auto p = &in[y * stride];
|
auto p = &in[y * stride];
|
||||||
auto q = &out[y];
|
auto q = &out[y];
|
||||||
auto by = std::min(h, y + BLOCK) - y;
|
auto by = std::min(h, y + BLOCK) - y;
|
||||||
for (int xx = 0; xx < bx; ++xx) {
|
for (int32_t xx = 0; xx < bx; ++xx) {
|
||||||
for (int yy = 0; yy < by; ++yy) {
|
for (int32_t yy = 0; yy < by; ++yy) {
|
||||||
*q = *p;
|
*q = *p;
|
||||||
p += stride;
|
p += stride;
|
||||||
++q;
|
++q;
|
||||||
|
|
Loading…
Add table
Reference in a new issue