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
7474 static Field copyfield;
7575 static int altdown;
7676 static int mode = Minsert;
77−static long framedev; /* frame deviation >= 1µs */
77+static long framedev; /* frame deviation >= 1ms */
7878
7979 static char *style[Numstyles] = {
8080 [Sfancy] = "fancy",
@@ -282,7 +282,7 @@ orcathread(void *drawchan) · 201 unmodified lines
282282 oldbpm = bpm;
283283 }
284284
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_ */
286286 if (n < oldn)
287287 end -= oldn - n;
288288
@@ -295,7 +295,7 @@ orcathread(void *drawchan) · 6 unmodified lines
295295 sleep(1);
296296 }
297297
298− framedev = (processnew - processold - 15000000000LL/bpm) / 1000LL;
298+ framedev = labs(processnew/1000LL - processold/1000LL)/1000L - 15000L/bpm;
299299 tick++;
300300 }
301301 }
@@ -425,7 +425,7 @@ redraw(void) · 123 unmodified lines
425425 /* frame deviation */
426426 p.y -= font->height;
427427 p.x += charw * (len + Coloff);
428− len = MAX(6, runesprint(linebuf, "%ldµs", labs(framedev)));
428+ len = MAX(6, runesprint(linebuf, "%ldms", labs(framedev)));
429429 runestring(screen, p, color[Dfhigh], ZP, font, linebuf);
430430
431431 USED(len);
@@ -694,7 +694,7 @@ threadmain(int argc, char **argv) · 262 unmodified lines
694694 a[Ckey].c = kchan;
695695 a[Cmouse].c = mctl->c;
696696 a[Cresize].c = mctl->resizec;
697− a[Credraw].c = chancreate(sizeof(ulong), 1);
697+ a[Credraw].c = chancreate(sizeof(ulong), 0);
698698
699699 for (n = 0; n < Numcolors; n++)
700700 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