app,app/internal/wm: fold context MakeCurrent/ReleaseCurrent into Lock/Unlock

While here, make context Refresh useful and remove the redundant
MakeCurrent from the window loop.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2021-08-04 12:03:04 +02:00
parent 4dd6a50670
commit 0bdc2e0432
11 changed files with 83 additions and 132 deletions
+7 -10
View File
@@ -50,10 +50,6 @@ func (c *context) Release() {
}
func (c *context) Refresh() error {
return nil
}
func (c *context) MakeCurrent() error {
c.Context.ReleaseSurface()
if c.eglWin != nil {
C.wl_egl_window_destroy(c.eglWin)
@@ -69,12 +65,13 @@ func (c *context) MakeCurrent() error {
}
c.eglWin = eglWin
eglSurf := egl.NativeWindowType(uintptr(unsafe.Pointer(eglWin)))
if err := c.Context.CreateSurface(eglSurf, width, height); err != nil {
return err
}
return c.Context.CreateSurface(eglSurf, width, height)
}
func (c *context) Lock() error {
return c.Context.MakeCurrent()
}
func (c *context) Lock() {}
func (c *context) Unlock() {}
func (c *context) Unlock() {
c.Context.ReleaseCurrent()
}