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:
Elias Naur
2019-04-25 09:56:34 +02:00
parent 47fbe56766
commit e0d586893d
+1 -3
View File
@@ -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