From owner-p4-projects@FreeBSD.ORG Fri Jul 20 22:34:59 2012 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3A24B1065673; Fri, 20 Jul 2012 22:34:59 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CB457106564A for ; Fri, 20 Jul 2012 22:34:58 +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 B45258FC1B for ; Fri, 20 Jul 2012 22:34:58 +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 q6KMYwOk063774 for ; Fri, 20 Jul 2012 22:34:58 GMT (envelope-from brooks@freebsd.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.4/8.14.4/Submit) id q6KMYwS3063771 for perforce@freebsd.org; Fri, 20 Jul 2012 22:34:58 GMT (envelope-from brooks@freebsd.org) Date: Fri, 20 Jul 2012 22:34:58 GMT Message-Id: <201207202234.q6KMYwS3063771@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 214660 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: Fri, 20 Jul 2012 22:34:59 -0000 http://p4web.freebsd.org/@@214660?ac=10 Change 214660 by brooks@brooks_ecr_current on 2012/07/20 22:33:55 Convert pictview_pan() to use ts_poll(). With the new version that debounces releases and fakes extra releases when one wasn't generated properly this is much smoother than the old version. Affected files ... .. //depot/projects/ctsrd/beribsd/src/ctsrd/pictview/pictview.c#11 edit Differences ... ==== //depot/projects/ctsrd/beribsd/src/ctsrd/pictview/pictview.c#11 (text+ko) ==== @@ -494,8 +494,8 @@ int pan_direction = -1; int next_display_image = display_image; int k,x,y; - int touch_release = false; - int prev_touch_x0; + int prev_ts_x1; + struct tsstate *ts; if((display_image<1) || (display_image>pictview_num_photo)) { printf("pictview_pan assertion error: display_image=%1d out of range\n", @@ -505,9 +505,6 @@ // display image for(y=0; yts_gesture == TSG2_ZOOM_OUT) + break; - // while no pinch gesture - while(!((touch_count==2) && (touch_gesture==0x49))) { - // multitouch_pole(); - multitouch_filter(); - - if((touch_count==0) && (pan_direction!=-1)) { + if((ts->ts_count==0) && (pan_direction!=-1)) { // touch released so decide which image to view - if((pan_direction==0) && (touch_x0>(fb_width/2))) + if((pan_direction==0) && (ts->ts_x1>(fb_width/2))) display_image = next_display_image; - if((pan_direction==1) && (touch_x0<(fb_width/2))) + if((pan_direction==1) && (ts->ts_x1<(fb_width/2))) display_image = next_display_image; pan_direction = -1; for(k=0; k(5*fb_width/6))) { // pan image to right + if(ts->ts_count==1) { + if((pan_direction==-1) && (ts->ts_x1>(5*fb_width/6))) { // pan image to right pan_direction=1; next_display_image = (display_image % pictview_num_photo)+1; - prev_touch_x0 = fb_width-1; + prev_ts_x1 = fb_width-1; //printf("display_image=%1d next_display_image=%1d\n",display_image,next_display_image); } - if((pan_direction==-1) && (touch_x0<(fb_width/6))) { // pan image to left + if((pan_direction==-1) && (ts->ts_x1<(fb_width/6))) { // pan image to left pan_direction=0; next_display_image = ((pictview_num_photo+display_image-2) % pictview_num_photo)+1; - prev_touch_x0 = 0; + prev_ts_x1 = 0; // printf("display_image=%1d next_display_image=%1d\n",display_image,next_display_image); } if(pan_direction!=-1) { @@ -565,13 +554,13 @@ // printf("%1d",pan_direction); for(y=0; yts_x1; x++) fb_buf[x+k] = pictview_imgs[img0][x+k]; - for(x=touch_x0; x<=prev_touch_x0; x++) + for(x=ts->ts_x1; x<=prev_ts_x1; x++) fb_buf[x+k] = pictview_imgs[img1][x+k]; } fb_post(fb_buf); - prev_touch_x0 = touch_x0; + prev_ts_x1 = ts->ts_x1; } } }