mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-07 10:25:37 +00:00
gpu/headless: remove useless headless_gl.go abstraction
There is no longer any shared code between OpenGL backends (unlike EGL backends). Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -22,7 +22,7 @@ type nsContext struct {
|
|||||||
ctx C.CFTypeRef
|
ctx C.CFTypeRef
|
||||||
}
|
}
|
||||||
|
|
||||||
func newGLContext() (context, error) {
|
func newContext() (context, error) {
|
||||||
ctx := C.gio_headless_newContext()
|
ctx := C.gio_headless_newContext()
|
||||||
return &nsContext{ctx: ctx}, nil
|
return &nsContext{ctx: ctx}, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// SPDX-License-Identifier: Unlicense OR MIT
|
// SPDX-License-Identifier: Unlicense OR MIT
|
||||||
|
|
||||||
//go:build linux || freebsd || windows || openbsd
|
//go:build linux || freebsd || openbsd
|
||||||
// +build linux freebsd windows openbsd
|
// +build linux freebsd openbsd
|
||||||
|
|
||||||
package headless
|
package headless
|
||||||
|
|
||||||
@@ -9,6 +9,6 @@ import (
|
|||||||
"gioui.org/internal/egl"
|
"gioui.org/internal/egl"
|
||||||
)
|
)
|
||||||
|
|
||||||
func newGLContext() (context, error) {
|
func newContext() (context, error) {
|
||||||
return egl.NewContext(egl.EGL_DEFAULT_DISPLAY)
|
return egl.NewContext(egl.EGL_DEFAULT_DISPLAY)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +0,0 @@
|
|||||||
// SPDX-License-Identifier: Unlicense OR MIT
|
|
||||||
|
|
||||||
//go:build !windows
|
|
||||||
// +build !windows
|
|
||||||
|
|
||||||
package headless
|
|
||||||
|
|
||||||
func newContext() (context, error) {
|
|
||||||
return newGLContext()
|
|
||||||
}
|
|
||||||
@@ -14,7 +14,7 @@ type jsContext struct {
|
|||||||
ctx js.Value
|
ctx js.Value
|
||||||
}
|
}
|
||||||
|
|
||||||
func newGLContext() (context, error) {
|
func newContext() (context, error) {
|
||||||
doc := js.Global().Get("document")
|
doc := js.Global().Get("document")
|
||||||
cnv := doc.Call("createElement", "canvas")
|
cnv := doc.Call("createElement", "canvas")
|
||||||
ctx := cnv.Call("getContext", "webgl2")
|
ctx := cnv.Call("getContext", "webgl2")
|
||||||
|
|||||||
Reference in New Issue
Block a user