app/internal/input: remove AddProfile method

Merge it into the general Add method.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2020-02-07 19:41:39 +01:00
parent 251c075093
commit 320535a978
2 changed files with 3 additions and 5 deletions
+2 -4
View File
@@ -69,6 +69,8 @@ func (q *Router) Frame(ops *op.Ops) {
func (q *Router) Add(e event.Event) bool {
switch e := e.(type) {
case profile.Event:
q.profile = e
case pointer.Event:
q.pqueue.Push(e, &q.handlers)
case key.EditEvent, key.Event, key.FocusEvent:
@@ -101,10 +103,6 @@ func (q *Router) collect() {
}
}
func (q *Router) AddProfile(profile profile.Event) {
q.profile = profile
}
func (q *Router) Profiling() bool {
return q.profiling
}
+1 -1
View File
@@ -138,7 +138,7 @@ func (w *Window) draw(frameStart time.Time, size image.Point, frame *op.Ops) {
frameDur = frameDur.Truncate(100 * time.Microsecond)
q := 100 * time.Microsecond
timings := fmt.Sprintf("tot:%7s %s", frameDur.Round(q), w.loop.Summary())
w.queue.q.AddProfile(profile.Event{Timings: timings})
w.queue.q.Add(profile.Event{Timings: timings})
}
if t, ok := w.queue.q.WakeupTime(); ok {
w.setNextFrame(t)