mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-04 00:45:35 +00:00
gpu: don't store transformed rectangle paths under the same cache key
Fixes incorrect rendering of multiple transformed instances of a rectangle. Fixes: https://todo.sr.ht/~eliasnaur/gio/635 Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -293,3 +293,20 @@ func TestStrokedRect(t *testing.T) {
|
||||
}, func(r result) {
|
||||
})
|
||||
}
|
||||
|
||||
func TestInstancedRects(t *testing.T) {
|
||||
run(t, func(o *op.Ops) {
|
||||
macro := op.Record(o)
|
||||
clip := clip.Rect{Max: image.Pt(20, 20)}.Push(o)
|
||||
paint.ColorOp{Color: color.NRGBA{R: 0x80, A: 0xFF}}.Add(o)
|
||||
paint.PaintOp{}.Add(o)
|
||||
clip.Pop()
|
||||
c := macro.Stop()
|
||||
|
||||
for i := 0; i < 2; i++ {
|
||||
op.Affine(f32.Affine2D{}.Rotate(f32.Pt(0, 0), .2)).Add(o)
|
||||
c.Add(o)
|
||||
op.Offset(image.Pt(20, 20)).Add(o)
|
||||
}
|
||||
}, nil)
|
||||
}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 787 B |
Reference in New Issue
Block a user