better
This commit is contained in:
parent
e8f72e4ae7
commit
2b1390cd37
1 changed files with 38 additions and 14 deletions
|
@ -16,23 +16,47 @@ block:
|
||||||
timeIt "fillOverlaps":
|
timeIt "fillOverlaps":
|
||||||
doAssert path.fillOverlaps(vec2(1, 1)) == false
|
doAssert path.fillOverlaps(vec2(1, 1)) == false
|
||||||
|
|
||||||
timeIt "roundedRect image":
|
const
|
||||||
const radius = 20
|
width = 500
|
||||||
|
height = 300
|
||||||
|
radius = 20
|
||||||
|
|
||||||
let path = newPath()
|
let path = newPath()
|
||||||
path.roundedRect(0.5, 0.5, 499, 299, radius, radius, radius, radius)
|
path.roundedRect(0.5, 0.5, 499, 299, radius, radius, radius, radius)
|
||||||
# path.roundedRect(0, 0, 500, 300, radius, radius, radius, radius)
|
# path.roundedRect(0, 0, 500, 300, radius, radius, radius, radius)
|
||||||
|
|
||||||
let image = newImage(500, 300)
|
timeIt "roundedRect Image OverwriteBlend":
|
||||||
image.fillPath(path, rgba(0, 0, 0, 255))
|
let paint = newPaint(SolidPaint)
|
||||||
|
paint.color = color(0, 0, 0, 1)
|
||||||
|
paint.blendMode = OverwriteBlend
|
||||||
|
|
||||||
|
let image = newImage(width, height)
|
||||||
|
image.fillPath(path, paint)
|
||||||
|
|
||||||
timeIt "roundedRect mask":
|
timeIt "roundedRect Image NormalBlend":
|
||||||
const radius = 20
|
let paint = newPaint(SolidPaint)
|
||||||
|
paint.color = color(0, 0, 0, 1)
|
||||||
|
paint.blendMode = NormalBlend
|
||||||
|
|
||||||
let path = newPath()
|
let image = newImage(width, height)
|
||||||
path.roundedRect(0.5, 0.5, 499, 299, radius, radius, radius, radius)
|
image.fillPath(path, paint)
|
||||||
# path.roundedRect(0, 0, 500, 300, radius, radius, radius, radius)
|
|
||||||
|
|
||||||
let mask = newMask(500, 300)
|
timeIt "roundedRect Image MaskBlend":
|
||||||
mask.fillPath(path)
|
let paint = newPaint(SolidPaint)
|
||||||
|
paint.color = color(0, 0, 0, 1)
|
||||||
|
paint.blendMode = MaskBlend
|
||||||
|
|
||||||
|
let image = newImage(width, height)
|
||||||
|
image.fillPath(path, paint)
|
||||||
|
|
||||||
|
timeIt "roundedRect Mask OverwriteBlend":
|
||||||
|
let mask = newMask(width, height)
|
||||||
|
mask.fillPath(path, blendMode = OverwriteBlend)
|
||||||
|
|
||||||
|
timeIt "roundedRect Mask NormalBlend":
|
||||||
|
let mask = newMask(width, height)
|
||||||
|
mask.fillPath(path, blendMode = NormalBlend)
|
||||||
|
|
||||||
|
timeIt "roundedRect Mask MaskBlend":
|
||||||
|
let mask = newMask(width, height)
|
||||||
|
mask.fillPath(path, blendMode = MaskBlend)
|
||||||
|
|
Loading…
Reference in a new issue