~eliasnaur/gio-example

ref: 112655e32697e0e4efdd57e100 gio-example/gophers/main_test.go -rw-r--r-- 375 bytes
112655e3Chris Waldon livedit: improve visual quality of demo 4 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// SPDX-License-Identifier: Unlicense OR MIT

package main

import (
	"image"
	"testing"

	"gioui.org/layout"
	"gioui.org/op"
)

func BenchmarkUI(b *testing.B) {
	fetch := func(_ string) {}
	u := newUI(fetch)
	var ops op.Ops
	for i := 0; i < b.N; i++ {
		gtx := layout.Context{
			Ops:         &ops,
			Constraints: layout.Exact(image.Pt(800, 600)),
		}
		u.Layout(gtx)
	}
}