mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 17:35:36 +00:00
app: don't lock up when using custom renderers
A recent change broke custom rendering by not allowing the client to continue after calling FrameEvent.Frame. This change makes sure the client is allowed to continue regardless of rendering mode. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+11
-11
@@ -218,7 +218,7 @@ func (w *Window) validateAndProcess(d driver, size image.Point, sync bool, frame
|
|||||||
w.gpu = gpu
|
w.gpu = gpu
|
||||||
}
|
}
|
||||||
if w.gpu != nil {
|
if w.gpu != nil {
|
||||||
if err := w.frame(frame, size, signal); err != nil {
|
if err := w.frame(frame, size); err != nil {
|
||||||
if errors.Is(err, errOutOfDate) {
|
if errors.Is(err, errOutOfDate) {
|
||||||
// GPU surface needs refreshing.
|
// GPU surface needs refreshing.
|
||||||
sync = true
|
sync = true
|
||||||
@@ -231,11 +231,19 @@ func (w *Window) validateAndProcess(d driver, size image.Point, sync bool, frame
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
w.queue.q.Frame(frame)
|
||||||
|
// We're done with frame, let the client continue.
|
||||||
|
if signal != nil {
|
||||||
|
signal <- struct{}{}
|
||||||
|
}
|
||||||
|
if w.gpu != nil {
|
||||||
|
return w.ctx.Present()
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (w *Window) frame(frame *op.Ops, viewport image.Point, signal chan<- struct{}) error {
|
func (w *Window) frame(frame *op.Ops, viewport image.Point) error {
|
||||||
if err := w.ctx.Lock(); err != nil {
|
if err := w.ctx.Lock(); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -251,15 +259,7 @@ func (w *Window) frame(frame *op.Ops, viewport image.Point, signal chan<- struct
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err := w.gpu.Frame(frame, target, viewport); err != nil {
|
return w.gpu.Frame(frame, target, viewport)
|
||||||
return err
|
|
||||||
}
|
|
||||||
w.queue.q.Frame(frame)
|
|
||||||
// We're done with frame, let the client continue.
|
|
||||||
if signal != nil {
|
|
||||||
signal <- struct{}{}
|
|
||||||
}
|
|
||||||
return w.ctx.Present()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (w *Window) processFrame(d driver, frameStart time.Time) {
|
func (w *Window) processFrame(d driver, frameStart time.Time) {
|
||||||
|
|||||||
Reference in New Issue
Block a user