Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Nov 2012 01:50:52 GMT
From:      Brooks Davis <brooks@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 219803 for review
Message-ID:  <201211160150.qAG1oq7G086467@skunkworks.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@219803?ac=10

Change 219803 by brooks@brooks_zenith on 2012/11/16 01:50:22

	Correct display of the header image by moving the rendering to
	the end and not drawing over it (except for the sandbox
	indicator).

Affected files ...

.. //depot/projects/ctsrd/cheribsd/src/ctsrd/cheripoint/cheripoint.c#10 edit

Differences ...

==== //depot/projects/ctsrd/cheribsd/src/ctsrd/cheripoint/cheripoint.c#10 (text+ko) ====

@@ -480,35 +480,7 @@
 	}
 	iboxstate_free(is);
 
-	/*
-	 * Draw the header with image at the upper right.  Assume
-	 * the background color is the same on each row and that the
-	 * left most pixel of the image is that color.
-	 */
-	if ((pfd = open("/usr/share/images/header.png", O_RDONLY)) == -1) {
-		warn("Failed to open header.png");
-		return (-1);
-	}
-	if ((hdris = png_read_start(pfd, slide_width, fb_height, -1, sb)) ==
-	    NULL) {
-		warn("Failed to start PNG decode for header.png");
-		return (-1);
-	}
-	if (png_read_finish(hdris) != 0) {
-		warnx("png_read_finish() failed for header.png");
-		return (-1);
-	}
-	/* Fill in the header's background. */
-	for (r = 0; r < hdris->height; r++)
-		fb_fill_region(hdris->buffer[r * hdris->width], 0, r,
-		fb_width, 1);
-	fb_post_region(__DEVOLATILE(uint32_t *, hdris->buffer),
-	    slide_fcol + slide_width - hdris->width, 0, hdris->width,
-	    hdris->height);
 	FB_BUSY;
-	if (sb_vis && sb != SB_NONE)
-		fb_rectangle(red, 2, slide_fcol + slide_width - hdris->width,
-		    0, hdris->width, hdris->height);
 
 	/* put an SRI logo in the lower left corner */
 	if ((pfd = open("/usr/share/images/sri.png", O_RDONLY)) == -1) {
@@ -568,14 +540,34 @@
 			free(snimage);
 	}
 
-	/* Drawing done, redraw header to clear FB_BUSY */
-	fb_post_region(__DEVOLATILE(uint32_t *, hdris->buffer),
-	    slide_fcol + slide_width - hdris->width, 0, hdris->width,
-	    hdris->height);
+	/*
+	 * Draw the header with image at the upper right.  Assume
+	 * the background color is the same on each row and that the
+	 * left most pixel of the image is that color.
+	 */
+	if ((pfd = open("/usr/share/images/header.png", O_RDONLY)) == -1) {
+		warn("Failed to open header.png");
+		return (-1);
+	}
+	if ((hdris = png_read_start(pfd, slide_width, fb_height, -1, sb)) ==
+	    NULL) {
+		warn("Failed to start PNG decode for header.png");
+		return (-1);
+	}
+	if (png_read_finish(hdris) != 0) {
+		warnx("png_read_finish() failed for header.png");
+		return (-1);
+	}
 	/* Fill in the header's background. */
 	for (r = 0; r < hdris->height; r++)
 		fb_fill_region(hdris->buffer[r * hdris->width], 0, r,
 		fb_width, 1);
+	fb_post_region(__DEVOLATILE(uint32_t *, hdris->buffer),
+	    slide_fcol + slide_width - hdris->width, 0, hdris->width,
+	    hdris->height);
+	if (sb_vis && sb != SB_NONE)
+		fb_rectangle(red, 2, slide_fcol + slide_width - hdris->width,
+		    0, hdris->width, hdris->height);
 	iboxstate_free(hdris);
 
 	return (error);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201211160150.qAG1oq7G086467>