mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
ui/app/internal/gpu: flush before drawing
And delete an unnecessary error check from Flush to make sure pending draws are always finalized. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -273,9 +273,6 @@ func (g *GPU) Release() {
|
||||
}
|
||||
|
||||
func (g *GPU) Flush() error {
|
||||
if g.err != nil {
|
||||
return g.err
|
||||
}
|
||||
if g.drawing {
|
||||
st := <-g.results
|
||||
g.setErr(st.err)
|
||||
@@ -305,6 +302,7 @@ func (g *GPU) Draw(profile bool, viewport image.Point, op ui.Op) {
|
||||
if g.err != nil {
|
||||
return
|
||||
}
|
||||
g.Flush()
|
||||
g.ops.collect(g.cache, op, viewport)
|
||||
g.frames <- frame{profile, viewport, g.ops}
|
||||
g.drawing = true
|
||||
|
||||
Reference in New Issue
Block a user