mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-03 08:25:34 +00:00
gpu: don't panic for nil op.Ops argument to GPU.Frame
Updates gio#306 Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -55,7 +55,7 @@ func newContext() (context, error) {
|
||||
if firstErr != nil {
|
||||
return nil, firstErr
|
||||
}
|
||||
return nil, errors.New("x11: no available GPU backends")
|
||||
return nil, errors.New("headless: no available GPU backends")
|
||||
}
|
||||
|
||||
// NewWindow creates a new headless window.
|
||||
|
||||
@@ -132,6 +132,14 @@ func TestDepth(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestNoOps(t *testing.T) {
|
||||
w, release := newTestWindow(t)
|
||||
defer release()
|
||||
if err := w.Frame(nil); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
func newTestWindow(t *testing.T) (*Window, func()) {
|
||||
t.Helper()
|
||||
sz := image.Point{X: 800, Y: 600}
|
||||
|
||||
Reference in New Issue
Block a user