History

plan9: framedev: show ms insted of µs; make redraw channel unbuffered

Sigrid Haflínudóttir committed 6 years ago

Commit 66b8fab1 parent 63f6c861 file · +5 −5Browse files

Unified · Split

plan9.c+5−5
@@ -74,7 +74,7 @@ static Channel *cchan; · 73 unmodified lines
74static Field copyfield;74static Field copyfield;
75static int altdown;75static int altdown;
76static int mode = Minsert;76static int mode = Minsert;
77static long framedev; /* frame deviation >= 1µs */77static long framedev; /* frame deviation >= 1ms */
78 78
79static char *style[Numstyles] = {79static char *style[Numstyles] = {
80 [Sfancy] = "fancy",80 [Sfancy] = "fancy",
@@ -282,7 +282,7 @@ orcathread(void *drawchan) · 201 unmodified lines
282 oldbpm = bpm;282 oldbpm = bpm;
283 }283 }
284 284
285 /* doesn't suppose to jump back, but just in case do _something_ */285 /* not supposed to jump back, but just in case, do _something_ */
286 if (n < oldn)286 if (n < oldn)
287 end -= oldn - n;287 end -= oldn - n;
288 288
@@ -295,7 +295,7 @@ orcathread(void *drawchan) · 6 unmodified lines
295 sleep(1);295 sleep(1);
296 }296 }
297 297
298 framedev = (processnew - processold - 15000000000LL/bpm) / 1000LL;298 framedev = labs(processnew/1000LL - processold/1000LL)/1000L - 15000L/bpm;
299 tick++;299 tick++;
300 }300 }
301}301}
@@ -425,7 +425,7 @@ redraw(void) · 123 unmodified lines
425 /* frame deviation */425 /* frame deviation */
426 p.y -= font->height;426 p.y -= font->height;
427 p.x += charw * (len + Coloff);427 p.x += charw * (len + Coloff);
428 len = MAX(6, runesprint(linebuf, "%ldµs", labs(framedev)));428 len = MAX(6, runesprint(linebuf, "%ldms", labs(framedev)));
429 runestring(screen, p, color[Dfhigh], ZP, font, linebuf);429 runestring(screen, p, color[Dfhigh], ZP, font, linebuf);
430 430
431 USED(len);431 USED(len);
@@ -694,7 +694,7 @@ threadmain(int argc, char **argv) · 262 unmodified lines
694 a[Ckey].c = kchan;694 a[Ckey].c = kchan;
695 a[Cmouse].c = mctl->c;695 a[Cmouse].c = mctl->c;
696 a[Cresize].c = mctl->resizec;696 a[Cresize].c = mctl->resizec;
697 a[Credraw].c = chancreate(sizeof(ulong), 1);697 a[Credraw].c = chancreate(sizeof(ulong), 0);
698 698
699 for (n = 0; n < Numcolors; n++)699 for (n = 0; n < Numcolors; n++)
700 color[n] = allocimage(display, Rect(0, 0, 1, 1), RGBA32, 1, setalpha(theme[n] & ~0xff, theme[n] & 0xff));700 color[n] = allocimage(display, Rect(0, 0, 1, 1), RGBA32, 1, setalpha(theme[n] & ~0xff, theme[n] & 0xff));

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t