mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 09:25:38 +00:00
gpu/internal/rendertest: test textured strokes, including clipping
The new compute renderer can draw simple strokes. Test that clipping works with a stroke basis, and that images can be drawn into strokes. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -118,6 +118,39 @@ func TestPaintTexture(t *testing.T) {
|
||||
})
|
||||
}
|
||||
|
||||
func TestTexturedStrokeClipped(t *testing.T) {
|
||||
run(t, func(o *op.Ops) {
|
||||
smallSquares.Add(o)
|
||||
op.Offset(f32.Pt(50, 50)).Add(o)
|
||||
clip.Stroke{
|
||||
Path: clip.RRect{Rect: f32.Rect(0, 0, 30, 30)}.Path(o),
|
||||
Style: clip.StrokeStyle{
|
||||
Width: 10,
|
||||
},
|
||||
}.Op().Add(o)
|
||||
clip.RRect{Rect: f32.Rect(-30, -30, 60, 60)}.Add(o)
|
||||
op.Offset(f32.Pt(-10, -10)).Add(o)
|
||||
paint.PaintOp{}.Add(o)
|
||||
}, func(r result) {
|
||||
})
|
||||
}
|
||||
|
||||
func TestTexturedStroke(t *testing.T) {
|
||||
run(t, func(o *op.Ops) {
|
||||
smallSquares.Add(o)
|
||||
op.Offset(f32.Pt(50, 50)).Add(o)
|
||||
clip.Stroke{
|
||||
Path: clip.RRect{Rect: f32.Rect(0, 0, 30, 30)}.Path(o),
|
||||
Style: clip.StrokeStyle{
|
||||
Width: 10,
|
||||
},
|
||||
}.Op().Add(o)
|
||||
op.Offset(f32.Pt(-10, -10)).Add(o)
|
||||
paint.PaintOp{}.Add(o)
|
||||
}, func(r result) {
|
||||
})
|
||||
}
|
||||
|
||||
func TestPaintClippedTexture(t *testing.T) {
|
||||
run(t, func(o *op.Ops) {
|
||||
squares.Add(o)
|
||||
|
||||
Reference in New Issue
Block a user