From owner-p4-projects@FreeBSD.ORG Thu Dec 6 21:22:00 2012 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D167E477; Thu, 6 Dec 2012 21:21: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 8E314475 for ; Thu, 6 Dec 2012 21:21:59 +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 5972F8FC15 for ; Thu, 6 Dec 2012 21:21:59 +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 qB6LLxj6060245 for ; Thu, 6 Dec 2012 21:21:59 GMT (envelope-from brooks@freebsd.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.5/8.14.5/Submit) id qB6LLx96060242 for perforce@freebsd.org; Thu, 6 Dec 2012 21:21:59 GMT (envelope-from brooks@freebsd.org) Date: Thu, 6 Dec 2012 21:21:59 GMT Message-Id: <201212062121.qB6LLx96060242@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to brooks@freebsd.org using -f From: Brooks Davis Subject: PERFORCE change 219892 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: Thu, 06 Dec 2012 21:22:00 -0000 http://p4web.freebsd.org/@@219892?ac=10 Change 219892 by brooks@brooks_zenith on 2012/12/06 21:21:35 In practice, all the functionality of render_cover() has been subsumed by render_slide()'s non-composite rendering of full height slides. Remove it accordingly. Fix incorrect sandbox indicators for full height slides. Affected files ... .. //depot/projects/ctsrd/cheribsd/src/ctsrd/cheripoint/cheripoint.c#19 edit Differences ... ==== //depot/projects/ctsrd/cheribsd/src/ctsrd/cheripoint/cheripoint.c#19 (text+ko) ==== @@ -440,54 +440,6 @@ } static int -render_cover(int dfd, const char *cover) -{ - int pfd; - uint32_t r, fcol; - struct iboxstate *is; - - busy(1); - - if ((pfd = openat(dfd, cover, O_RDONLY)) == -1) { - warn("Failed to open %s", cover); - return (-1); - } - if ((is = png_read_start(pfd, slide_width, fb_height, sb)) == - NULL) { - warn("Failed to start PNG decode for %s", cover); - return (-1); - } - if (png_read_finish(is) != 0) { - warnx("png_read_finish() failed for %s", cover); - return (-1); - } - fcol = slide_fcol + ((slide_width - is->width) / 2); - fb_fill_region(white, 0, 0, fb_width, fb_height); - fb_post_region(__DEVOLATILE(uint32_t *, is->buffer), fcol, 0, - is->width, is->height); - if (fcol > 0) { - /* Left extend the image if needed */ - for (r = 0; r < is->height; r++) - fb_fill_region(is->buffer[r * is->width], - 0, r, fcol, 1); - } - if (is->width < (uint)fb_width - fcol) { - /* Right extend the image if needed */ - for (r = 0; r < is->height; r++) - fb_fill_region(is->buffer[((r + 1) * is->width) - 1], - fcol + is->width, r, - fb_width - (fcol + is->width), 1); - } - if (sb_vis && sb != SB_NONE) - fb_rectangle(red, 2, fcol, 0, is->width, is->height); - iboxstate_free(is); - - unbusy(); - - return (0); -} - -static int render_slide(int dfd, int slidenum, const char *slide) { int error, pfd; @@ -546,9 +498,9 @@ 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), - header_height, is->width, - is->height < slide_height ? is->height : slide_height); + x, y, is->width, + is->height < (u_int)fb_height - y ? + (u_int)fb_height - y : is->height); switch (sb) { case SB_CAPSICUM: if (is->error == 99) @@ -938,7 +890,7 @@ free(coverpat); if (cover == ncovers) cover = 0; /* Smallest cover due to sort */ - render_cover(dirfd(dirp), covers[cover]); + render_slide(dirfd(dirp), 1, covers[cover]); *slidep = slide; /* Update post success */ } else { error = render_slide(dirfd(dirp),