PERFORCE change 219892 for review
Brooks Davis
brooks at FreeBSD.org
Thu Dec 6 21:22:00 UTC 2012
http://p4web.freebsd.org/@@219892?ac=10
Change 219892 by brooks at 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),
More information about the p4-projects
mailing list