gpu/internal/rendertest: test depth buffer overlaps

Regression test for 44991f355c

Signed-off-by: Egon Elbre <egonelbre@gmail.com>
This commit is contained in:
Egon Elbre
2021-03-06 16:25:09 +02:00
committed by Elias Naur
parent cb1defbc63
commit 5393a05110
2 changed files with 16 additions and 0 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 375 B

+16
View File
@@ -223,6 +223,22 @@ func TestNegativeOverlaps(t *testing.T) {
})
}
func TestDepthOverlap(t *testing.T) {
run(t, func(ops *op.Ops) {
stack := op.Save(ops)
paint.FillShape(ops, red, clip.Rect{Max: image.Pt(128, 64)}.Op())
stack.Load()
stack = op.Save(ops)
paint.FillShape(ops, green, clip.Rect{Max: image.Pt(64, 128)}.Op())
stack.Load()
}, func(r result) {
r.expect(96, 32, colornames.Red)
r.expect(32, 96, colornames.Green)
r.expect(32, 32, colornames.Green)
})
}
type Gradient struct {
From, To color.NRGBA
}