cmd,example: update gio version

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-12-02 13:20:20 +01:00
parent 11506a974e
commit 1762e0c07b
9 changed files with 12 additions and 42 deletions
+1 -3
View File
@@ -77,9 +77,7 @@ func initProfiling() {
func (a *App) run() error {
a.ui.profiling = *stats
gtx := &layout.Context{
Queue: a.w.Queue(),
}
gtx := layout.NewContext(a.w.Queue())
for {
select {
case users := <-a.updateUsers:
+2 -24
View File
@@ -5,38 +5,16 @@ 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),
}
gtx := new(layout.Context)
for i := 0; i < b.N; i++ {
gtx.Reset(cfg, image.Point{800, 600})
gtx.Reset(nil, 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)
}