samizdatco / skia-canvas

A GPU-accelerated 2D graphics environment for Node.js
MIT License
1.7k stars 66 forks source link

add blur show empty #88

Closed meihuanyu closed 2 years ago

meihuanyu commented 2 years ago
const {  Canvas } = require('skia-canvas')

const canvas = new Canvas(300, 300)
const ctx = canvas.getContext('2d')

ctx.filter = 'blur(5px)'
ctx.font = '50px serif';
ctx.fillText('test', 0, 50)

ctx.globalCompositeOperation = 'source-in'

ctx.scale(300, 300)
ctx.fillStyle = 'red'
ctx.fillRect(0, 0, 1, 1)

canvas.saveAs('a.png')

current:

a

expect: a