mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
Revert "app: optimize window context locking"
This reverts commit 3e601e73c4 because it
results in a blank window on Android.
Signed-off-by: Elias Naur <mail@eliasnaur.com>
Fixes: https://todo.sr.ht/~eliasnaur/gio/671
This commit is contained in:
+9
-5
@@ -142,11 +142,8 @@ func (w *Window) validateAndProcess(size image.Point, sync bool, frame *op.Ops,
|
|||||||
if w.gpu == nil && !w.nocontext {
|
if w.gpu == nil && !w.nocontext {
|
||||||
var err error
|
var err error
|
||||||
if w.ctx == nil {
|
if w.ctx == nil {
|
||||||
if w.ctx, err = w.driver.NewContext(); err != nil {
|
w.ctx, err = w.driver.NewContext()
|
||||||
return err
|
if err != nil {
|
||||||
}
|
|
||||||
if err = w.ctx.Lock(); err != nil {
|
|
||||||
w.destroyGPU()
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
sync = true
|
sync = true
|
||||||
@@ -166,6 +163,12 @@ func (w *Window) validateAndProcess(size image.Point, sync bool, frame *op.Ops,
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if w.ctx != nil {
|
||||||
|
if err := w.ctx.Lock(); err != nil {
|
||||||
|
w.destroyGPU()
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
if w.gpu == nil && !w.nocontext {
|
if w.gpu == nil && !w.nocontext {
|
||||||
gpu, err := gpu.New(w.ctx.API())
|
gpu, err := gpu.New(w.ctx.API())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -197,6 +200,7 @@ func (w *Window) validateAndProcess(size image.Point, sync bool, frame *op.Ops,
|
|||||||
var err error
|
var err error
|
||||||
if w.gpu != nil {
|
if w.gpu != nil {
|
||||||
err = w.ctx.Present()
|
err = w.ctx.Present()
|
||||||
|
w.ctx.Unlock()
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user