mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 18:05:35 +00:00
gpu/internal/rendertest: allow nil pixel check functions
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -132,8 +132,7 @@ func TestTexturedStrokeClipped(t *testing.T) {
|
|||||||
defer clip.RRect{Rect: image.Rect(-30, -30, 60, 60)}.Push(o).Pop()
|
defer clip.RRect{Rect: image.Rect(-30, -30, 60, 60)}.Push(o).Pop()
|
||||||
defer op.Offset(image.Pt(-10, -10)).Push(o).Pop()
|
defer op.Offset(image.Pt(-10, -10)).Push(o).Pop()
|
||||||
paint.PaintOp{}.Add(o)
|
paint.PaintOp{}.Add(o)
|
||||||
}, func(r result) {
|
}, nil)
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestTexturedStroke(t *testing.T) {
|
func TestTexturedStroke(t *testing.T) {
|
||||||
@@ -146,8 +145,7 @@ func TestTexturedStroke(t *testing.T) {
|
|||||||
}.Op().Push(o).Pop()
|
}.Op().Push(o).Pop()
|
||||||
defer op.Offset(image.Pt(-10, -10)).Push(o).Pop()
|
defer op.Offset(image.Pt(-10, -10)).Push(o).Pop()
|
||||||
paint.PaintOp{}.Add(o)
|
paint.PaintOp{}.Add(o)
|
||||||
}, func(r result) {
|
}, nil)
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestPaintClippedTexture(t *testing.T) {
|
func TestPaintClippedTexture(t *testing.T) {
|
||||||
@@ -252,8 +250,7 @@ func TestPathReuse(t *testing.T) {
|
|||||||
stroke := clip.Stroke{Path: spec, Width: 3}.Op().Push(o)
|
stroke := clip.Stroke{Path: spec, Width: 3}.Op().Push(o)
|
||||||
paint.Fill(o, color.NRGBA{B: 0xFF, A: 0xFF})
|
paint.Fill(o, color.NRGBA{B: 0xFF, A: 0xFF})
|
||||||
stroke.Pop()
|
stroke.Pop()
|
||||||
}, func(r result) {
|
}, nil)
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestPathInterleave(t *testing.T) {
|
func TestPathInterleave(t *testing.T) {
|
||||||
@@ -290,8 +287,7 @@ func TestStrokedRect(t *testing.T) {
|
|||||||
Width: 5,
|
Width: 5,
|
||||||
}.Op(),
|
}.Op(),
|
||||||
)
|
)
|
||||||
}, func(r result) {
|
}, nil)
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestInstancedRects(t *testing.T) {
|
func TestInstancedRects(t *testing.T) {
|
||||||
|
|||||||
@@ -124,8 +124,7 @@ func TestDeferredPaint(t *testing.T) {
|
|||||||
defer clip.Rect(image.Rect(0, 0, 80, 80)).Op().Push(o).Pop()
|
defer clip.Rect(image.Rect(0, 0, 80, 80)).Op().Push(o).Pop()
|
||||||
paint.ColorOp{Color: color.NRGBA{A: 0x60, B: 0xff}}.Add(o)
|
paint.ColorOp{Color: color.NRGBA{A: 0x60, B: 0xff}}.Add(o)
|
||||||
paint.PaintOp{}.Add(o)
|
paint.PaintOp{}.Add(o)
|
||||||
}, func(r result) {
|
}, nil)
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func constSqPath() clip.Op {
|
func constSqPath() clip.Op {
|
||||||
@@ -323,7 +322,7 @@ func TestLinearGradientAngled(t *testing.T) {
|
|||||||
cl = clip.Rect(image.Rect(0, 64, 64, 128)).Push(ops)
|
cl = clip.Rect(image.Rect(0, 64, 64, 128)).Push(ops)
|
||||||
paint.PaintOp{}.Add(ops)
|
paint.PaintOp{}.Add(ops)
|
||||||
cl.Pop()
|
cl.Pop()
|
||||||
}, func(r result) {})
|
}, nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestZeroImage(t *testing.T) {
|
func TestZeroImage(t *testing.T) {
|
||||||
@@ -492,8 +491,7 @@ func TestOpacity(t *testing.T) {
|
|||||||
opc3 := paint.PushOpacity(ops, .6)
|
opc3 := paint.PushOpacity(ops, .6)
|
||||||
paint.FillShape(ops, color.NRGBA{B: 255, A: 255}, clip.Ellipse(image.Rectangle{Min: image.Pt(20+20, 10), Max: image.Pt(50+64, 128)}).Op(ops))
|
paint.FillShape(ops, color.NRGBA{B: 255, A: 255}, clip.Ellipse(image.Rectangle{Min: image.Pt(20+20, 10), Max: image.Pt(50+64, 128)}).Op(ops))
|
||||||
opc3.Pop()
|
opc3.Pop()
|
||||||
}, func(r result) {
|
}, nil)
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// lerp calculates linear interpolation with color b and p.
|
// lerp calculates linear interpolation with color b and p.
|
||||||
|
|||||||
@@ -90,7 +90,9 @@ func run(t *testing.T, f func(o *op.Ops), c func(r result)) {
|
|||||||
name := fmt.Sprintf("%s-%d-bad.png", t.Name(), i)
|
name := fmt.Sprintf("%s-%d-bad.png", t.Name(), i)
|
||||||
saveImage(t, name, img)
|
saveImage(t, name, img)
|
||||||
}
|
}
|
||||||
c(result{t: t, img: img})
|
if c != nil {
|
||||||
|
c(result{t: t, img: img})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user