mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-03 16:35:36 +00:00
gpu: build gpu data also when outside window
This commit fixes a bug where a shape first drawn off-screen and later moved into screen would not display properly. Since we cache CPU operations (vertex transform / construction) we need to upload the constructed data to the GPU after it was build, or a later frame will use non-initialized memory for it's draw call. Note that this fix removes the optimization of not processing clip paths outside the screen - but this is assumed to be uncommon except when it is first drawn off screen to later be moved in (e.g. in a scrolling list) in which case we do want to upload the data and prepare for that later call. This commit also does a few minor clean ups and adds a test case. Signed-off-by: Viktor <viktor.ogeman@gmail.com>
This commit is contained in:
@@ -62,11 +62,11 @@ func (r *Reader) Reset(ops *op.Ops) {
|
||||
}
|
||||
|
||||
func (k Key) SetTransform(t f32.Affine2D) Key {
|
||||
sx, hx, sy, hy, _, _ := t.Elems()
|
||||
sx, hx, _, hy, sy, _ := t.Elems()
|
||||
k.sx = sx
|
||||
k.hx = hx
|
||||
k.sy = sy
|
||||
k.hy = hy
|
||||
k.sy = sy
|
||||
return k
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user