fix pixieNoSimd bug + add to github actions

This commit is contained in:
Ryan Oldenburg 2021-06-18 15:10:00 -05:00
parent 818d7522c1
commit 54ee511a47
2 changed files with 12 additions and 10 deletions

View file

@ -13,5 +13,6 @@ jobs:
- uses: actions/checkout@v2
- uses: jiro4989/setup-nim-action@v1
- run: nimble test -d:release -y
- run: nimble test -d:release -d:pixieNoSimd -y
- run: nimble test --gc:orc -d:release -y
- run: nim cpp -d:release -r tests/all.nim

View file

@ -753,31 +753,32 @@ proc drawUber(a, b: Image | Mask, mat = mat3(), blendMode = bmNormal) =
)
x += 16
for _ in x ..< xMax:
let
srcPos = p + dx * x.float32 + dy * y.float32
xFloat = srcPos.x - h
yFloat = srcPos.y - h
var srcPos = p + dx * x.float32 + dy * y.float32
srcPos = vec2(max(0, srcPos.x), max(0, srcPos.y))
for x in x ..< xMax:
let samplePos = ivec2((srcPos.x - h).int32, (srcPos.y - h).int32)
when type(a) is Image:
let backdrop = a.getRgbaUnsafe(x, y)
when type(b) is Image:
let
sample = b.getRgbaUnsafe(xFloat.int, yFloat.int)
sample = b.getRgbaUnsafe(samplePos.x, samplePos.y)
blended = blender(backdrop, sample)
else: # b is a Mask
let
sample = b.getValueUnsafe(xFloat.int, yFloat.int)
sample = b.getValueUnsafe(samplePos.x, samplePos.y)
blended = blender(backdrop, rgbx(0, 0, 0, sample))
a.setRgbaUnsafe(x, y, blended)
else: # a is a Mask
let backdrop = a.getValueUnsafe(x, y)
when type(b) is Image:
let sample = b.getRgbaUnsafe(xFloat.int, yFloat.int).a
let sample = b.getRgbaUnsafe(samplePos.x, samplePos.y).a
else: # b is a Mask
let sample = b.getValueUnsafe(xFloat.int, yFloat.int)
let sample = b.getValueUnsafe(samplePos.x, samplePos.y)
a.setValueUnsafe(x, y, masker(backdrop, sample))
inc x
srcPos += dx
if blendMode == bmIntersectMask:
if a.width - xMax > 0: