Files
gio/apps/gophers/main_test.go
T
Elias Naur 1673600ac6 apps: update gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-10-02 15:36:36 +02:00

43 lines
622 B
Go

// SPDX-License-Identifier: Unlicense OR MIT
package main
import (
"image"
"testing"
"time"
"gioui.org/io/event"
"gioui.org/layout"
"gioui.org/unit"
)
type queue struct{}
type config struct{}
func BenchmarkUI(b *testing.B) {
fetch := func(_ string) {}
u := newUI(fetch)
cfg := new(config)
gtx := &layout.Context{
Queue: new(queue),
}
for i := 0; i < b.N; i++ {
gtx.Reset(cfg, image.Point{800, 600})
u.Layout(gtx)
}
}
func (queue) Events(k event.Key) []event.Event {
return nil
}
func (config) Now() time.Time {
return time.Now()
}
func (config) Px(v unit.Value) int {
return int(v.V + .5)
}