From owner-p4-projects@FreeBSD.ORG Wed Jul 18 21:48:12 2012 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 440A210657F7; Wed, 18 Jul 2012 21:48:11 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF4C210657E2 for ; Wed, 18 Jul 2012 21:48:10 +0000 (UTC) (envelope-from brooks@freebsd.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id BF07A8FC15 for ; Wed, 18 Jul 2012 21:48:10 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.4/8.14.4) with ESMTP id q6ILmAZl034051 for ; Wed, 18 Jul 2012 21:48:10 GMT (envelope-from brooks@freebsd.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.4/8.14.4/Submit) id q6ILmAOD034048 for perforce@freebsd.org; Wed, 18 Jul 2012 21:48:10 GMT (envelope-from brooks@freebsd.org) Date: Wed, 18 Jul 2012 21:48:10 GMT Message-Id: <201207182148.q6ILmAOD034048@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to brooks@freebsd.org using -f From: Brooks Davis To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 214576 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2012 21:48:12 -0000 http://p4web.freebsd.org/@@214576?ac=10 Change 214576 by brooks@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); } }