diff --git a/image_test.go b/image_test.go index f379d4331..33be215d3 100644 --- a/image_test.go +++ b/image_test.go @@ -29,7 +29,6 @@ import ( "github.com/hajimehoshi/ebiten/v2/examples/resources/images" "github.com/hajimehoshi/ebiten/v2/internal/graphics" t "github.com/hajimehoshi/ebiten/v2/internal/testing" - "github.com/hajimehoshi/ebiten/v2/internal/web" ) func skipTooSlowTests(t *testing.T) bool { @@ -37,10 +36,6 @@ func skipTooSlowTests(t *testing.T) bool { t.Skip("skipping test in short mode") return true } - if web.IsGopherJS() { - t.Skip("too slow on GopherJS") - return true - } if runtime.GOOS == "js" { t.Skip("too slow or fragile on Wasm") return true diff --git a/internal/graphics/vertex.go b/internal/graphics/vertex.go index 9122e8b84..8c94d34f4 100644 --- a/internal/graphics/vertex.go +++ b/internal/graphics/vertex.go @@ -61,7 +61,7 @@ type verticesBackend struct { } func (v *verticesBackend) slice(n int, last bool) []float32 { - // As this is called only from GopherJS, mutex is not required. + // As this is called only on browsers, mutex is not required. need := n * VertexFloatNum if l := len(v.backend); v.head+need > l { @@ -84,7 +84,7 @@ func (v *verticesBackend) slice(n int, last bool) []float32 { func vertexSlice(n int, last bool) []float32 { if web.IsBrowser() { - // In GopherJS and Wasm, allocating memory by make is expensive. Use the backend instead. + // In Wasm, allocating memory by make is expensive. Use the backend instead. return theVerticesBackend.slice(n, last) } return make([]float32, n*VertexFloatNum) diff --git a/internal/jsutil/doc.go b/internal/jsutil/doc.go index 9a19c709b..02853fee8 100644 --- a/internal/jsutil/doc.go +++ b/internal/jsutil/doc.go @@ -15,5 +15,5 @@ // This can be compiled in non-JS environments to avoid a mysterious error: 'no Go source files' // See https://travis-ci.org/hajimehoshi/ebiten/builds/603539948 -// Package jsutil offers utility functions for GopherJS and Wasm. +// Package jsutil offers utility functions for Wasm. package jsutil diff --git a/internal/uidriver/js/ui.go b/internal/uidriver/js/ui.go index 79b0c52af..5da7ef915 100644 --- a/internal/uidriver/js/ui.go +++ b/internal/uidriver/js/ui.go @@ -17,8 +17,6 @@ package js import ( - "log" - "runtime" "syscall/js" "time" @@ -411,22 +409,7 @@ func (u *UserInterface) Run(context driver.UIContext) error { canvas.Call("focus") } u.running = true - ch := u.loop(context) - if runtime.GOARCH == "wasm" { - return <-ch - } - - // On GopherJS, the main goroutine cannot be blocked due to the bug (gopherjs/gopherjs#826). - // Return immediately. - go func() { - defer func() { - u.running = false - }() - if err := <-ch; err != nil { - log.Fatal(err) - } - }() - return nil + return <-u.loop(context) } func (u *UserInterface) RunWithoutMainLoop(context driver.UIContext) { diff --git a/internal/web/js.go b/internal/web/js.go index 9ebb188f3..9db61a059 100644 --- a/internal/web/js.go +++ b/internal/web/js.go @@ -17,7 +17,6 @@ package web import ( - "runtime" "strings" "syscall/js" ) @@ -26,10 +25,6 @@ func IsBrowser() bool { return true } -func IsGopherJS() bool { - return IsBrowser() && runtime.GOOS != "js" -} - var ( userAgent = js.Global().Get("navigator").Get("userAgent").String() diff --git a/internal/web/notjs.go b/internal/web/notjs.go index 313a6ee3b..65fd6cd89 100644 --- a/internal/web/notjs.go +++ b/internal/web/notjs.go @@ -20,10 +20,6 @@ func IsBrowser() bool { return false } -func IsGopherJS() bool { - return false -} - func IsIOSSafari() bool { return false } diff --git a/run.go b/run.go index 84a62380b..7a5df74c1 100644 --- a/run.go +++ b/run.go @@ -153,13 +153,9 @@ func (i *imageDumperGameWithDraw) Layout(outsideWidth, outsideHeight int) (scree // TPS (ticks per second) is 60 by default. // This is not related to framerate (display's refresh rate). // -// On non-GopherJS environments, RunGame returns error when 1) OpenGL error happens, 2) audio error happens or +// RunGame returns error when 1) OpenGL error happens, 2) audio error happens or // 3) f returns error. In the case of 3), RunGame returns the same error. // -// On GopherJS, RunGame returns immediately. -// It is because the 'main' goroutine cannot be blocked on GopherJS due to the bug (gopherjs/gopherjs#826). -// When an error happens, this is shown as an error on the console. -// // The size unit is device-independent pixel. // // Don't call RunGame twice or more in one process.