graphicscommand: Unexport RunOnMainThread

This commit is contained in:
Hajime Hoshi 2020-10-14 23:37:28 +09:00
parent fe6a2daef4
commit 20b4a28801
2 changed files with 4 additions and 4 deletions

View File

@ -200,7 +200,7 @@ func (q *commandQueue) Enqueue(command command) {
// Flush flushes the command queue. // Flush flushes the command queue.
func (q *commandQueue) Flush() error { func (q *commandQueue) Flush() error {
return RunOnMainThread(func() error { return runOnMainThread(func() error {
return q.flush() return q.flush()
}) })
} }
@ -725,7 +725,7 @@ func (c *newShaderCommand) CanMergeWithDrawTrianglesCommand(dst *Image, src [gra
// ResetGraphicsDriverState resets or initializes the current graphics driver state. // ResetGraphicsDriverState resets or initializes the current graphics driver state.
func ResetGraphicsDriverState() error { func ResetGraphicsDriverState() error {
return RunOnMainThread(func() error { return runOnMainThread(func() error {
return theGraphicsDriver.Reset() return theGraphicsDriver.Reset()
}) })
} }
@ -733,7 +733,7 @@ func ResetGraphicsDriverState() error {
// MaxImageSize returns the maximum size of an image. // MaxImageSize returns the maximum size of an image.
func MaxImageSize() int { func MaxImageSize() int {
var size int var size int
_ = RunOnMainThread(func() error { _ = runOnMainThread(func() error {
size = theGraphicsDriver.MaxImageSize() size = theGraphicsDriver.MaxImageSize()
return nil return nil
}) })

View File

@ -24,7 +24,7 @@ func SetMainThread(thread *thread.Thread) {
theThread = thread theThread = thread
} }
func RunOnMainThread(f func() error) error { func runOnMainThread(f func() error) error {
// The thread is nil when 1) GOOS=js or 2) using golang.org/x/mobile/gl. // The thread is nil when 1) GOOS=js or 2) using golang.org/x/mobile/gl.
// When golang.org/x/mobile/gl is used, all the GL functions are called via Context, which already runs on an // When golang.org/x/mobile/gl is used, all the GL functions are called via Context, which already runs on an
// appropriate thread. // appropriate thread.