example,cmd: bump gio version

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2020-05-03 21:06:02 +02:00
parent 8d9612f9aa
commit a1166e6652
11 changed files with 20 additions and 20 deletions
+1 -1
View File
@@ -3,7 +3,7 @@ module gioui.org/cmd
go 1.13 go 1.13
require ( 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/cdproto v0.0.0-20191114225735-6626966fbae4
github.com/chromedp/chromedp v0.5.2 github.com/chromedp/chromedp v0.5.2
golang.org/x/image v0.0.0-20190802002840-cff245a6509b golang.org/x/image v0.0.0-20190802002840-cff245a6509b
+2 -2
View File
@@ -1,6 +1,6 @@
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= 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-20200503190452-8d9612f9aa46 h1:7OFSBlHlymqJPrX54xUKnattrlsTxmVbTZwtFbG+kgU=
gioui.org v0.0.0-20200429080307-4bde9fbcaa2d/go.mod h1:AHI9rFr6AEEHCb8EPVtb/p5M+NMJRKH58IOp8O3Je04= 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 h1:1BDTz0u9nC3//pOCMdNH+CiXJVYJh5UQNCOBG7jbELc=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= 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= github.com/chromedp/cdproto v0.0.0-20191114225735-6626966fbae4 h1:QD3KxSJ59L2lxG6MXBjNHxiQO2RmxTQ3XcK+wO44WOg=
+2 -2
View File
@@ -53,7 +53,7 @@ func loop(w *app.Window) error {
color: color.RGBA{R: 0x00, G: 0x00, B: 0x00, A: 0x80}, color: color.RGBA{R: 0x00, G: 0x00, B: 0x00, A: 0x80},
} }
gtx := layout.NewContext(w.Queue()) gtx := new(layout.Context)
for { for {
e := <-w.Events() e := <-w.Events()
switch e := e.(type) { switch e := e.(type) {
@@ -61,7 +61,7 @@ func loop(w *app.Window) error {
return e.Err return e.Err
case system.FrameEvent: 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.Flex{Axis: layout.Vertical}.Layout(gtx,
layout.Flexed(0.5, func() { layout.Flexed(0.5, func() {
layout.Flex{Axis: layout.Horizontal}.Layout(gtx, layout.Flex{Axis: layout.Horizontal}.Layout(gtx,
+2 -2
View File
@@ -63,7 +63,7 @@ func main() {
gofont.Register() gofont.Register()
f := new(goglFunctions) f := new(goglFunctions)
var queue router.Router var queue router.Router
gtx := layout.NewContext(&queue) gtx := new(layout.Context)
th := material.NewTheme() th := material.NewTheme()
backend, err := giogl.NewBackend(f) backend, err := giogl.NewBackend(f)
if err != nil { if err != nil {
@@ -84,7 +84,7 @@ func main() {
} }
width, height := window.GetSize() width, height := window.GetSize()
sz := image.Point{X: width, Y: height} sz := image.Point{X: width, Y: height}
gtx.Reset(&glfwConfig{scale}, sz) gtx.Reset(&queue, &glfwConfig{scale}, sz)
draw(gtx, th) draw(gtx, th)
gpu.Collect(sz, gtx.Ops) gpu.Collect(sz, gtx.Ops)
gpu.BeginFrame() gpu.BeginFrame()
+1 -1
View File
@@ -3,7 +3,7 @@ module gioui.org/example
go 1.13 go 1.13
require ( 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/gl v0.0.0-20190320180904-bf2b1f2f34d7
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72 github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72
github.com/google/go-github/v24 v24.0.1 github.com/google/go-github/v24 v24.0.1
+2 -2
View File
@@ -1,7 +1,7 @@
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= 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= 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-20200503190452-8d9612f9aa46 h1:7OFSBlHlymqJPrX54xUKnattrlsTxmVbTZwtFbG+kgU=
gioui.org v0.0.0-20200503110304-060cff257f1d/go.mod h1:AHI9rFr6AEEHCb8EPVtb/p5M+NMJRKH58IOp8O3Je04= 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/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 h1:SCYMcCJ89LjRGwEa0tRluNRiMjZHalQZrVrvTbPh+qw=
github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7/go.mod h1:482civXOzJJCPzJ4ZOX/pwvXBWSnzD4OKMdH4ClKGbk= github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7/go.mod h1:482civXOzJJCPzJ4ZOX/pwvXBWSnzD4OKMdH4ClKGbk=
+2 -2
View File
@@ -77,7 +77,7 @@ func initProfiling() {
func (a *App) run() error { func (a *App) run() error {
a.ui.profiling = *stats a.ui.profiling = *stats
gtx := layout.NewContext(a.w.Queue()) gtx := new(layout.Context)
for { for {
select { select {
case users := <-a.updateUsers: case users := <-a.updateUsers:
@@ -125,7 +125,7 @@ func (a *App) run() error {
} }
} }
case system.FrameEvent: case system.FrameEvent:
gtx.Reset(e.Config, e.Size) gtx.Reset(e.Queue, e.Config, e.Size)
a.ui.Layout(gtx) a.ui.Layout(gtx)
e.Frame(gtx.Ops) e.Frame(gtx.Ops)
} }
+1 -1
View File
@@ -14,7 +14,7 @@ func BenchmarkUI(b *testing.B) {
u := newUI(fetch) u := newUI(fetch)
gtx := new(layout.Context) gtx := new(layout.Context)
for i := 0; i < b.N; i++ { 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) u.Layout(gtx)
} }
} }
+2 -2
View File
@@ -30,14 +30,14 @@ func main() {
func loop(w *app.Window) error { func loop(w *app.Window) error {
gofont.Register() gofont.Register()
th := material.NewTheme() th := material.NewTheme()
gtx := layout.NewContext(w.Queue()) gtx := new(layout.Context)
for { for {
e := <-w.Events() e := <-w.Events()
switch e := e.(type) { switch e := e.(type) {
case system.DestroyEvent: case system.DestroyEvent:
return e.Err return e.Err
case system.FrameEvent: case system.FrameEvent:
gtx.Reset(e.Config, e.Size) gtx.Reset(e.Queue, e.Config, e.Size)
l := material.H1(th, "Hello, Gio") l := material.H1(th, "Hello, Gio")
maroon := color.RGBA{127, 0, 0, 255} maroon := color.RGBA{127, 0, 0, 255}
l.Color = maroon l.Color = maroon
+3 -3
View File
@@ -82,7 +82,7 @@ func saveScreenshot(f string) error {
return err return err
} }
gtx := new(layout.Context) gtx := new(layout.Context)
gtx.Reset(&scaledConfig{scale}, sz) gtx.Reset(nil, &scaledConfig{scale}, sz)
th := material.NewTheme() th := material.NewTheme()
kitchen(gtx, th) kitchen(gtx, th)
w.Frame(gtx.Ops) w.Frame(gtx.Ops)
@@ -99,8 +99,8 @@ func saveScreenshot(f string) error {
func loop(w *app.Window) error { func loop(w *app.Window) error {
th := material.NewTheme() th := material.NewTheme()
gtx := layout.NewContext(w.Queue())
gtx := new(layout.Context)
for { for {
select { select {
case e := <-w.Events(): case e := <-w.Events():
@@ -108,7 +108,7 @@ func loop(w *app.Window) error {
case system.DestroyEvent: case system.DestroyEvent:
return e.Err return e.Err
case system.FrameEvent: case system.FrameEvent:
gtx.Reset(e.Config, e.Size) gtx.Reset(e.Queue, e.Config, e.Size)
kitchen(gtx, th) kitchen(gtx, th)
e.Frame(gtx.Ops) e.Frame(gtx.Ops)
} }
+2 -2
View File
@@ -33,14 +33,14 @@ func main() {
func loop(w *app.Window) error { func loop(w *app.Window) error {
gofont.Register() gofont.Register()
th := material.NewTheme() th := material.NewTheme()
gtx := layout.NewContext(w.Queue()) gtx := new(layout.Context)
for { for {
e := <-w.Events() e := <-w.Events()
switch e := e.(type) { switch e := e.(type) {
case system.DestroyEvent: case system.DestroyEvent:
return e.Err return e.Err
case system.FrameEvent: case system.FrameEvent:
gtx.Reset(e.Config, e.Size) gtx.Reset(e.Queue, e.Config, e.Size)
drawTabs(gtx, th) drawTabs(gtx, th)
e.Frame(gtx.Ops) e.Frame(gtx.Ops)
} }