mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-04 08:55:35 +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:
@@ -25,8 +25,9 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
dumpImages = flag.Bool("saveimages", false, "save test images")
|
||||
squares paint.ImageOp
|
||||
dumpImages = flag.Bool("saveimages", false, "save test images")
|
||||
squares paint.ImageOp
|
||||
smallSquares paint.ImageOp
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -39,8 +40,11 @@ var (
|
||||
)
|
||||
|
||||
func init() {
|
||||
// build the texture we use for testing
|
||||
size := 512
|
||||
squares = buildSquares(512)
|
||||
smallSquares = buildSquares(50)
|
||||
}
|
||||
|
||||
func buildSquares(size int) paint.ImageOp {
|
||||
sub := size / 4
|
||||
im := image.NewNRGBA(image.Rect(0, 0, size, size))
|
||||
c1, c2 := image.NewUniform(colornames.Green), image.NewUniform(colornames.Blue)
|
||||
@@ -51,7 +55,7 @@ func init() {
|
||||
}
|
||||
c1, c2 = c2, c1
|
||||
}
|
||||
squares = paint.NewImageOp(im)
|
||||
return paint.NewImageOp(im)
|
||||
}
|
||||
|
||||
func drawImage(t *testing.T, size int, ops *op.Ops, draw func(o *op.Ops)) (im *image.RGBA, err error) {
|
||||
|
||||
Reference in New Issue
Block a user