mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-07 10:25:37 +00:00
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:
@@ -69,6 +69,8 @@ func (q *Router) Frame(ops *op.Ops) {
|
|||||||
|
|
||||||
func (q *Router) Add(e event.Event) bool {
|
func (q *Router) Add(e event.Event) bool {
|
||||||
switch e := e.(type) {
|
switch e := e.(type) {
|
||||||
|
case profile.Event:
|
||||||
|
q.profile = e
|
||||||
case pointer.Event:
|
case pointer.Event:
|
||||||
q.pqueue.Push(e, &q.handlers)
|
q.pqueue.Push(e, &q.handlers)
|
||||||
case key.EditEvent, key.Event, key.FocusEvent:
|
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 {
|
func (q *Router) Profiling() bool {
|
||||||
return q.profiling
|
return q.profiling
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -138,7 +138,7 @@ func (w *Window) draw(frameStart time.Time, size image.Point, frame *op.Ops) {
|
|||||||
frameDur = frameDur.Truncate(100 * time.Microsecond)
|
frameDur = frameDur.Truncate(100 * time.Microsecond)
|
||||||
q := 100 * time.Microsecond
|
q := 100 * time.Microsecond
|
||||||
timings := fmt.Sprintf("tot:%7s %s", frameDur.Round(q), w.loop.Summary())
|
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 {
|
if t, ok := w.queue.q.WakeupTime(); ok {
|
||||||
w.setNextFrame(t)
|
w.setNextFrame(t)
|
||||||
|
|||||||
Reference in New Issue
Block a user