PERFORCE change 214576 for review

Brooks Davis brooks at FreeBSD.org
Wed Jul 18 21:48:12 UTC 2012


http://p4web.freebsd.org/@@214576?ac=10

Change 214576 by brooks at brooks_ecr_current on 2012/07/18 21:47:43

	Remove the save/restore function from the dialog box.  When
	(ab)using it as a text viewer the refresh is distracting noise.
	
	Remove some debug printf()s.
	
	Debounce gestures in the dialog code.  The current code isn't
	ideal due to the apparent lack of a release event when you leave
	the screen area, but it's better than the previous behavior
	where we got several swipe gestures queued up and couldn't
	scroll properly.

Affected files ...

.. //depot/projects/ctsrd/beribsd/src/ctsrd-lib/libde4tc/de4tc.c#10 edit

Differences ...

==== //depot/projects/ctsrd/beribsd/src/ctsrd-lib/libde4tc/de4tc.c#10 (text+ko) ====

@@ -583,7 +583,7 @@
 	int textheight, textwidth, titleheight, titlewidth;
 	char **lines;
 	char *textdup;
-	u_int32_t *textbuf, *titlebuf, *bgimage;
+	u_int32_t *textbuf, *titlebuf;
 	struct tsstate *ts;
 
 	titlewidth = strlen(title) * fb_get_font_width() * 2;
@@ -637,11 +637,6 @@
 	}
 	textlines++;
 
-	bgimage = malloc(sizeof(u_int32_t) * fb_width * fb_height);
-	if (bgimage == NULL)
-		err(1, "malloc");
-	fb_save(bgimage);
-
 	fb_fill_region(bgcolor, x0, y0, dwidth, dheight);
 	for (x = x0 + FBD_BORDER_SPACE; x < x0 + dwidth - FBD_BORDER_SPACE;
 	    x++) {
@@ -672,12 +667,10 @@
 	    titlewidth, titleheight);
 	free(titlebuf);
 
-	printf("text width %d height %d\n", textwidth, textheight);
 	textbuf = malloc(sizeof(u_int32_t) * textwidth * textheight);
 	if (textbuf == NULL)
 		err(1, "malloc");
 	for(i = 0; i < textlines; i++) {
-		printf("writing text '%s'\n", lines[i]);
 		fb_fill_buf(textbuf, bgcolor, textwidth, textheight);
 		fb_render_text(lines[i], 2, tcolor, bgcolor, textbuf,
 		    textwidth, textheight);
@@ -693,7 +686,8 @@
 		for (;;) {
 			ts = ts_poll();
 			if (ts->ts_gesture == TSG2_ZOOM_OUT) {
-				fb_post(bgimage);
+				while (ts_poll()->ts_count != 0)
+					/* do nothing */;
 				return(FBDA_OK);
 			}
 		}
@@ -702,15 +696,18 @@
 			ts = ts_poll();
 			switch (ts->ts_gesture) {
 			case TSG2_ZOOM_OUT:
-				fb_post(bgimage);
+				while (ts_poll()->ts_count != 0)
+					/* do nothing */;
 				return(FBDA_OK);
 			case TSG_NORTH:
 			case TSG2_NORTH:
-				fb_post(bgimage);
+				while (ts_poll()->ts_count != 0)
+					/* do nothing */;
 				return(FBDA_DOWN);
 			case TSG_SOUTH:
 			case TSG2_SOUTH:
-				fb_post(bgimage);
+				while (ts_poll()->ts_count != 0)
+					/* do nothing */;
 				return(FBDA_UP);
 			}
 		}


More information about the p4-projects mailing list