Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Jul 2012 20:16:13 GMT
From:      Brooks Davis <brooks@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 214345 for review
Message-ID:  <201207132016.q6DKGDsQ025760@skunkworks.freebsd.org>

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

Change 214345 by brooks@brooks_ecr_current on 2012/07/13 20:15:15

	Add a public function to save the current framebuffer contents to a
	buffer.
	
	Save and restore the framebuffer after displaying a dialog box.

Affected files ...

.. //depot/projects/ctsrd/beribsd/src/ctsrd-lib/libde4tc/de4tc.c#8 edit
.. //depot/projects/ctsrd/beribsd/src/ctsrd-lib/libde4tc/de4tc.h#8 edit

Differences ...

==== //depot/projects/ctsrd/beribsd/src/ctsrd-lib/libde4tc/de4tc.c#8 (text+ko) ====

@@ -297,6 +297,16 @@
 
 
 void
+fb_save(u_int32_t *buf)
+{
+  int i;
+
+  for (i = 0; i < fb_height * fb_width; i++)
+    buf[i] = pfbp[i];
+}
+
+
+void
 fb_blend(int blend_text_bg, int blend_text_fg, int blend_pixel, int wash __unused)
 {
   mtlctrl[0] =
@@ -534,7 +544,7 @@
 	int textheight, textwidth, titleheight, titlewidth;
 	char **lines;
 	char *textdup;
-	u_int32_t *textbuf, *titlebuf;
+	u_int32_t *textbuf, *titlebuf, *bgimage;
 	struct tsstate *ts;
 
 	titlewidth = strlen(title) * fb_get_font_width() * 2;
@@ -587,6 +597,11 @@
 	}
 	textlines++;
 
+	bgimage = malloc(sizeof(u_int32_t) * fb_width * fb_height);
+	if (bgimage == NULL)
+		err(1, "malloc");
+	fb_save(bgimage);
+
 	fb_fill_region(bgcolor, x0, y0, dwidth, dheight);
 	for (x = x0 + FBD_BORDER_SPACE; x < x0 + dwidth - FBD_BORDER_SPACE;
 	    x++) {
@@ -637,8 +652,10 @@
 	case FBDT_PINCH2CLOSE:
 		for (;;) {
 			ts = ts_poll();
-			if (ts->ts_gesture == TSG2_ZOOM_OUT)
+			if (ts->ts_gesture == TSG2_ZOOM_OUT) {
+				fb_post(bgimage);
 				return(FBDA_OK);
+			}
 		}
 	default:
 		err(1, "Unhandled dialog type");

==== //depot/projects/ctsrd/beribsd/src/ctsrd-lib/libde4tc/de4tc.h#8 (text+ko) ====

@@ -108,6 +108,7 @@
 void fb_fill_buf(u_int32_t *buf, u_int32_t color, int width, int height);
 void fb_post(u_int32_t *buf);
 void fb_post_region(u_int32_t *buf, int x, int y, int w, int h);
+void fb_save(u_int32_t *buf);
 void fb_blend(int blend_text_bg, int blend_text_fg, int blend_pixel, int wash);
 void fb_text_cursor(int x, int y);
 void fb_fade2off(void);



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