fix pixieNoSimd bug + add to github actions
This commit is contained in:
parent
818d7522c1
commit
54ee511a47
2 changed files with 12 additions and 10 deletions
1
.github/workflows/build.yml
vendored
1
.github/workflows/build.yml
vendored
|
@ -13,5 +13,6 @@ jobs:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: jiro4989/setup-nim-action@v1
|
- uses: jiro4989/setup-nim-action@v1
|
||||||
- run: nimble test -d:release -y
|
- run: nimble test -d:release -y
|
||||||
|
- run: nimble test -d:release -d:pixieNoSimd -y
|
||||||
- run: nimble test --gc:orc -d:release -y
|
- run: nimble test --gc:orc -d:release -y
|
||||||
- run: nim cpp -d:release -r tests/all.nim
|
- run: nim cpp -d:release -r tests/all.nim
|
||||||
|
|
|
@ -753,31 +753,32 @@ proc drawUber(a, b: Image | Mask, mat = mat3(), blendMode = bmNormal) =
|
||||||
)
|
)
|
||||||
x += 16
|
x += 16
|
||||||
|
|
||||||
for _ in x ..< xMax:
|
var srcPos = p + dx * x.float32 + dy * y.float32
|
||||||
let
|
srcPos = vec2(max(0, srcPos.x), max(0, srcPos.y))
|
||||||
srcPos = p + dx * x.float32 + dy * y.float32
|
|
||||||
xFloat = srcPos.x - h
|
for x in x ..< xMax:
|
||||||
yFloat = srcPos.y - h
|
let samplePos = ivec2((srcPos.x - h).int32, (srcPos.y - h).int32)
|
||||||
|
|
||||||
when type(a) is Image:
|
when type(a) is Image:
|
||||||
let backdrop = a.getRgbaUnsafe(x, y)
|
let backdrop = a.getRgbaUnsafe(x, y)
|
||||||
when type(b) is Image:
|
when type(b) is Image:
|
||||||
let
|
let
|
||||||
sample = b.getRgbaUnsafe(xFloat.int, yFloat.int)
|
sample = b.getRgbaUnsafe(samplePos.x, samplePos.y)
|
||||||
blended = blender(backdrop, sample)
|
blended = blender(backdrop, sample)
|
||||||
else: # b is a Mask
|
else: # b is a Mask
|
||||||
let
|
let
|
||||||
sample = b.getValueUnsafe(xFloat.int, yFloat.int)
|
sample = b.getValueUnsafe(samplePos.x, samplePos.y)
|
||||||
blended = blender(backdrop, rgbx(0, 0, 0, sample))
|
blended = blender(backdrop, rgbx(0, 0, 0, sample))
|
||||||
a.setRgbaUnsafe(x, y, blended)
|
a.setRgbaUnsafe(x, y, blended)
|
||||||
else: # a is a Mask
|
else: # a is a Mask
|
||||||
let backdrop = a.getValueUnsafe(x, y)
|
let backdrop = a.getValueUnsafe(x, y)
|
||||||
when type(b) is Image:
|
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
|
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))
|
a.setValueUnsafe(x, y, masker(backdrop, sample))
|
||||||
inc x
|
|
||||||
|
srcPos += dx
|
||||||
|
|
||||||
if blendMode == bmIntersectMask:
|
if blendMode == bmIntersectMask:
|
||||||
if a.width - xMax > 0:
|
if a.width - xMax > 0:
|
||||||
|
|
Loading…
Reference in a new issue