~eliasnaur/gio-example

ref: 1ad8d13d0f99c508d3a2528dfe349f3313acc7c5 gio-example/gophers/main_test.go -rw-r--r-- 375 bytes
1ad8d13dChris Waldon windows,multiwindow: rename package for clarity 5 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)
	}
}