From owner-p4-projects@FreeBSD.ORG Tue Nov 27 22:14:27 2012 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 41AD9A6A; Tue, 27 Nov 2012 22:14:27 +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 01D43A67 for ; Tue, 27 Nov 2012 22:14:27 +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 C3A7A8FC16 for ; Tue, 27 Nov 2012 22:14:26 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.5/8.14.5) with ESMTP id qARMEQsn036534 for ; Tue, 27 Nov 2012 22:14:26 GMT (envelope-from brooks@freebsd.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.5/8.14.5/Submit) id qARMEQ5W036531 for perforce@freebsd.org; Tue, 27 Nov 2012 22:14:26 GMT (envelope-from brooks@freebsd.org) Date: Tue, 27 Nov 2012 22:14:26 GMT Message-Id: <201211272214.qARMEQ5W036531@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to brooks@freebsd.org using -f From: Brooks Davis Subject: PERFORCE change 219856 for review To: Perforce Change Reviews Precedence: bulk X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.14 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 22:14:27 -0000 http://p4web.freebsd.org/@@219856?ac=10 Change 219856 by brooks@brooks_zenith on 2012/11/27 22:14:22 If a slide body is the full height of the framebuffer, render it without a header or the SRI and Cambride logos to make it easier to create alternate slide decks. Affected files ... .. //depot/projects/ctsrd/cheribsd/src/ctsrd/cheripoint/cheripoint.c#12 edit Differences ... ==== //depot/projects/ctsrd/cheribsd/src/ctsrd/cheripoint/cheripoint.c#12 (text+ko) ==== @@ -487,6 +487,7 @@ { int error, pfd; int f_width, f_height; + int x, y, w, h; uint sv1, sv2; size_t olen; char sntext[8]; @@ -509,7 +510,7 @@ sysctlbyname("security.cheri.syscall_violations", &sv1, &olen, NULL, 0); } - if ((is = png_read_start(pfd, slide_width, fb_height, slidenum, + if ((is = png_read_start(pfd, fb_width, fb_height, slidenum, sb)) == NULL) { warn("Failed to start PNG decode for %s", slide); return (-1); @@ -520,9 +521,27 @@ } fb_fill_region(white, 0, 0, fb_width, fb_height); busy(0); - fb_post_region(__DEVOLATILE(uint32_t *, is->buffer), - slide_fcol + ((slide_width - is->width) / 2), header_height, - is->width, is->height < slide_height ? is->height : slide_height); + /* + * If the image is the full display height, assume it's meant to be + * displayed as a simple slide without compositing. Make a decent + * effort to display it in a nice place horizontaly. + */ + if (is->height == (u_int)fb_height) { + y = 0; + h = is->height; + } else { + h = is->height < slide_height ? is->height : slide_height; + y = header_height; + } + if (is->width > slide_width) { + if (is->width < fb_width - slide_fcol) + x = slide_fcol; + else + x = 0; + } else + x = slide_fcol + ((slide_width - is->width) / 2); + w = is->width; + fb_post_region(__DEVOLATILE(uint32_t *, is->buffer), x, y, w, h); if (sb_vis && sb != SB_NONE) fb_rectangle(red, 2, slide_fcol + ((slide_width - is->width) / 2), @@ -545,6 +564,12 @@ } iboxstate_free(is); + /* Skip the rest in the full height image case */ + if (y == 0) { + unbusy(); + return (0); + } + busy(0); /* put an SRI logo in the lower left corner */