app: don't schedule a new frame for profiling events

Sometimes it's useful to profile yet not continously re-draw. If the programs
wants the old behaviour, it can issue an InvalidateOp or call
Window.Invalidate.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-11-08 13:02:19 +01:00
parent e16712321f
commit f6cdc62120
2 changed files with 21 additions and 10 deletions
-1
View File
@@ -145,7 +145,6 @@ func (w *Window) draw(size image.Point, frame *op.Ops) {
q := 100 * time.Microsecond
timings := fmt.Sprintf("tot:%7s cpu:%7s %s", frameDur.Round(q), drawDur.Round(q), w.gpu.Timings())
w.queue.q.AddProfile(profile.Event{Timings: timings})
w.setNextFrame(time.Time{})
}
if t, ok := w.queue.q.WakeupTime(); ok {
w.setNextFrame(t)