gpu/internal/rendertest: add regression test for issue 331

References: https://todo.sr.ht/~eliasnaur/gio/331
Signed-off-by: Andy Balholm <andy@balholm.com>
This commit is contained in:
Andy Balholm
2022-01-11 11:24:53 -08:00
committed by Elias Naur
parent b2a99fddca
commit 456f22c986
3 changed files with 28 additions and 1 deletions
+22
View File
@@ -185,6 +185,28 @@ func TestStrokedPathZeroWidth(t *testing.T) {
})
}
func TestStrokedPathCoincidentControlPoint(t *testing.T) {
run(t, func(o *op.Ops) {
p := new(clip.Path)
p.Begin(o)
p.MoveTo(f32.Pt(70, 20))
p.CubeTo(f32.Pt(70, 20), f32.Pt(70, 110), f32.Pt(120, 120))
p.LineTo(f32.Pt(20, 120))
p.LineTo(f32.Pt(70, 20))
cl := clip.Stroke{
Path: p.End(),
Width: 20,
}.Op().Push(o)
paint.Fill(o, black)
cl.Pop()
}, func(r result) {
r.expect(0, 0, transparent)
r.expect(70, 20, colornames.Black)
r.expect(70, 90, transparent)
})
}
func TestPathReuse(t *testing.T) {
run(t, func(o *op.Ops) {
var path clip.Path