morepretty

This commit is contained in:
Ryan Oldenburg 2022-08-01 13:12:17 -05:00
parent 48d1b17bc4
commit 0f80f9a385
3 changed files with 5 additions and 4 deletions

View file

@ -447,7 +447,9 @@ proc blendLineOverwrite(
) {.inline.} = ) {.inline.} =
copyMem(a[0].addr, b[0].addr, len * 4) copyMem(a[0].addr, b[0].addr, len * 4)
proc blendLineNormal(a, b: ptr UncheckedArray[ColorRGBX], len: int) {.hasSimd.} = proc blendLineNormal(
a, b: ptr UncheckedArray[ColorRGBX], len: int
) {.hasSimd.} =
for i in 0 ..< len: for i in 0 ..< len:
a[i] = blendNormal(a[i], b[i]) a[i] = blendNormal(a[i], b[i])

View file

@ -128,7 +128,6 @@ proc fillGradientLinear(image: Image, paint: Paint) =
t = toLineSpace(at, to, xy) t = toLineSpace(at, to, xy)
rgbx = paint.gradientColor(t) rgbx = paint.gradientColor(t)
colors[i] = rgbx colors[i] = rgbx
when defined(amd64): when defined(amd64):
let colorVec = mm_loadu_si128(colors[0].addr) let colorVec = mm_loadu_si128(colors[0].addr)
for y in 0 ..< image.height: for y in 0 ..< image.height:

View file

@ -691,7 +691,7 @@ proc blendLineMaskSse2*(
a, b: ptr UncheckedArray[ColorRGBX], len: int a, b: ptr UncheckedArray[ColorRGBX], len: int
) {.simd.} = ) {.simd.} =
var i: int var i: int
while i < len and (cast[uint](a[i].addr) and 15) != 0: while i < len and (cast[uint](a[i].addr) and 15) != 0:
a[i] = blendMask(a[i], b[i]) a[i] = blendMask(a[i], b[i])
inc i inc i
@ -721,7 +721,7 @@ proc blendLineCoverageMaskSse2*(
len: int len: int
) {.simd.} = ) {.simd.} =
var i: int var i: int
while i < len and (cast[uint](line[i].addr) and 15) != 0: while i < len and (cast[uint](line[i].addr) and 15) != 0:
let coverage = coverages[i] let coverage = coverages[i]
if coverage == 0: if coverage == 0:
line[i] = rgbx(0, 0, 0, 0) line[i] = rgbx(0, 0, 0, 0)