diff --git a/cmd/go.mod b/cmd/go.mod index 1ae8c5e8..788ac944 100644 --- a/cmd/go.mod +++ b/cmd/go.mod @@ -3,7 +3,7 @@ module gioui.org/cmd go 1.13 require ( - gioui.org v0.0.0-20200429080307-4bde9fbcaa2d + gioui.org v0.0.0-20200503190452-8d9612f9aa46 github.com/chromedp/cdproto v0.0.0-20191114225735-6626966fbae4 github.com/chromedp/chromedp v0.5.2 golang.org/x/image v0.0.0-20190802002840-cff245a6509b diff --git a/cmd/go.sum b/cmd/go.sum index f0a06e59..10fd26b5 100644 --- a/cmd/go.sum +++ b/cmd/go.sum @@ -1,6 +1,6 @@ dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -gioui.org v0.0.0-20200429080307-4bde9fbcaa2d h1:mCIOi978xzjyQD5og9H5LxGJA+ZW+fDzkidNuCKCPDo= -gioui.org v0.0.0-20200429080307-4bde9fbcaa2d/go.mod h1:AHI9rFr6AEEHCb8EPVtb/p5M+NMJRKH58IOp8O3Je04= +gioui.org v0.0.0-20200503190452-8d9612f9aa46 h1:7OFSBlHlymqJPrX54xUKnattrlsTxmVbTZwtFbG+kgU= +gioui.org v0.0.0-20200503190452-8d9612f9aa46/go.mod h1:AHI9rFr6AEEHCb8EPVtb/p5M+NMJRKH58IOp8O3Je04= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802 h1:1BDTz0u9nC3//pOCMdNH+CiXJVYJh5UQNCOBG7jbELc= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/chromedp/cdproto v0.0.0-20191114225735-6626966fbae4 h1:QD3KxSJ59L2lxG6MXBjNHxiQO2RmxTQ3XcK+wO44WOg= diff --git a/cmd/gogio/testdata/red.go b/cmd/gogio/testdata/red.go index dad808bf..eda14907 100644 --- a/cmd/gogio/testdata/red.go +++ b/cmd/gogio/testdata/red.go @@ -53,7 +53,7 @@ func loop(w *app.Window) error { color: color.RGBA{R: 0x00, G: 0x00, B: 0x00, A: 0x80}, } - gtx := layout.NewContext(w.Queue()) + gtx := new(layout.Context) for { e := <-w.Events() switch e := e.(type) { @@ -61,7 +61,7 @@ func loop(w *app.Window) error { return e.Err case system.FrameEvent: - gtx.Reset(e.Config, e.Size) + gtx.Reset(e.Queue, e.Config, e.Size) layout.Flex{Axis: layout.Vertical}.Layout(gtx, layout.Flexed(0.5, func() { layout.Flex{Axis: layout.Horizontal}.Layout(gtx, diff --git a/example/glfw/main.go b/example/glfw/main.go index 75bc709f..463bc92e 100644 --- a/example/glfw/main.go +++ b/example/glfw/main.go @@ -63,7 +63,7 @@ func main() { gofont.Register() f := new(goglFunctions) var queue router.Router - gtx := layout.NewContext(&queue) + gtx := new(layout.Context) th := material.NewTheme() backend, err := giogl.NewBackend(f) if err != nil { @@ -84,7 +84,7 @@ func main() { } width, height := window.GetSize() sz := image.Point{X: width, Y: height} - gtx.Reset(&glfwConfig{scale}, sz) + gtx.Reset(&queue, &glfwConfig{scale}, sz) draw(gtx, th) gpu.Collect(sz, gtx.Ops) gpu.BeginFrame() diff --git a/example/go.mod b/example/go.mod index 35882cc8..76003829 100644 --- a/example/go.mod +++ b/example/go.mod @@ -3,7 +3,7 @@ module gioui.org/example go 1.13 require ( - gioui.org v0.0.0-20200503110304-060cff257f1d + gioui.org v0.0.0-20200503190452-8d9612f9aa46 github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7 github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72 github.com/google/go-github/v24 v24.0.1 diff --git a/example/go.sum b/example/go.sum index 6a057737..7d49141a 100644 --- a/example/go.sum +++ b/example/go.sum @@ -1,7 +1,7 @@ cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -gioui.org v0.0.0-20200503110304-060cff257f1d h1:wG4S7JnaiBYGgVk7hFa61sHrxcz6iI8Y9twYOHTLBzg= -gioui.org v0.0.0-20200503110304-060cff257f1d/go.mod h1:AHI9rFr6AEEHCb8EPVtb/p5M+NMJRKH58IOp8O3Je04= +gioui.org v0.0.0-20200503190452-8d9612f9aa46 h1:7OFSBlHlymqJPrX54xUKnattrlsTxmVbTZwtFbG+kgU= +gioui.org v0.0.0-20200503190452-8d9612f9aa46/go.mod h1:AHI9rFr6AEEHCb8EPVtb/p5M+NMJRKH58IOp8O3Je04= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7 h1:SCYMcCJ89LjRGwEa0tRluNRiMjZHalQZrVrvTbPh+qw= github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7/go.mod h1:482civXOzJJCPzJ4ZOX/pwvXBWSnzD4OKMdH4ClKGbk= diff --git a/example/gophers/main.go b/example/gophers/main.go index 26087cd4..73a925d3 100644 --- a/example/gophers/main.go +++ b/example/gophers/main.go @@ -77,7 +77,7 @@ func initProfiling() { func (a *App) run() error { a.ui.profiling = *stats - gtx := layout.NewContext(a.w.Queue()) + gtx := new(layout.Context) for { select { case users := <-a.updateUsers: @@ -125,7 +125,7 @@ func (a *App) run() error { } } case system.FrameEvent: - gtx.Reset(e.Config, e.Size) + gtx.Reset(e.Queue, e.Config, e.Size) a.ui.Layout(gtx) e.Frame(gtx.Ops) } diff --git a/example/gophers/main_test.go b/example/gophers/main_test.go index d998b95c..5b7018d1 100644 --- a/example/gophers/main_test.go +++ b/example/gophers/main_test.go @@ -14,7 +14,7 @@ func BenchmarkUI(b *testing.B) { u := newUI(fetch) gtx := new(layout.Context) for i := 0; i < b.N; i++ { - gtx.Reset(nil, image.Point{800, 600}) + gtx.Reset(nil, nil, image.Point{800, 600}) u.Layout(gtx) } } diff --git a/example/hello/hello.go b/example/hello/hello.go index c5fa3d25..5bfc6f31 100644 --- a/example/hello/hello.go +++ b/example/hello/hello.go @@ -30,14 +30,14 @@ func main() { func loop(w *app.Window) error { gofont.Register() th := material.NewTheme() - gtx := layout.NewContext(w.Queue()) + gtx := new(layout.Context) for { e := <-w.Events() switch e := e.(type) { case system.DestroyEvent: return e.Err case system.FrameEvent: - gtx.Reset(e.Config, e.Size) + gtx.Reset(e.Queue, e.Config, e.Size) l := material.H1(th, "Hello, Gio") maroon := color.RGBA{127, 0, 0, 255} l.Color = maroon diff --git a/example/kitchen/kitchen.go b/example/kitchen/kitchen.go index 9a0b8888..e43eec1b 100644 --- a/example/kitchen/kitchen.go +++ b/example/kitchen/kitchen.go @@ -82,7 +82,7 @@ func saveScreenshot(f string) error { return err } gtx := new(layout.Context) - gtx.Reset(&scaledConfig{scale}, sz) + gtx.Reset(nil, &scaledConfig{scale}, sz) th := material.NewTheme() kitchen(gtx, th) w.Frame(gtx.Ops) @@ -99,8 +99,8 @@ func saveScreenshot(f string) error { func loop(w *app.Window) error { th := material.NewTheme() - gtx := layout.NewContext(w.Queue()) + gtx := new(layout.Context) for { select { case e := <-w.Events(): @@ -108,7 +108,7 @@ func loop(w *app.Window) error { case system.DestroyEvent: return e.Err case system.FrameEvent: - gtx.Reset(e.Config, e.Size) + gtx.Reset(e.Queue, e.Config, e.Size) kitchen(gtx, th) e.Frame(gtx.Ops) } diff --git a/example/tabs/tabs.go b/example/tabs/tabs.go index 01ae6f52..94d15e20 100644 --- a/example/tabs/tabs.go +++ b/example/tabs/tabs.go @@ -33,14 +33,14 @@ func main() { func loop(w *app.Window) error { gofont.Register() th := material.NewTheme() - gtx := layout.NewContext(w.Queue()) + gtx := new(layout.Context) for { e := <-w.Events() switch e := e.(type) { case system.DestroyEvent: return e.Err case system.FrameEvent: - gtx.Reset(e.Config, e.Size) + gtx.Reset(e.Queue, e.Config, e.Size) drawTabs(gtx, th) e.Frame(gtx.Ops) }