PERFORCE change 219771 for review

Brooks Davis brooks at FreeBSD.org
Tue Nov 13 20:39:35 UTC 2012


http://p4web.freebsd.org/@@219771?ac=10

Change 219771 by brooks at brooks_zenith on 2012/11/13 20:39:24

	Add fb_composite() so we can build up image buffers prior to
	rendering them.

Affected files ...

.. //depot/projects/ctsrd/cheribsd/src/ctsrd-lib/libde4tc/de4tc.c#6 edit
.. //depot/projects/ctsrd/cheribsd/src/ctsrd-lib/libde4tc/de4tc.h#6 edit

Differences ...

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

@@ -369,6 +369,21 @@
     pfbp[addr] = col;
 }
 
+int
+fb_composite(u_int32_t *dbuf, int dwidth, int dheight, int x, int y,
+    const u_int32_t *sbuf, int swidth, int sheight)
+{
+  int col, row;
+
+  if (dwidth - x < swidth || dheight - y < sheight)
+    return (-1);
+
+  for (row = 0; row < sheight; row++)
+    for (col = 0; col < swidth; col++)
+      dbuf[(y + row) * dwidth + (x + col)] = sbuf[row * swidth + col];
+
+  return (0);
+}
 
 void
 fb_fill_region(u_int32_t colour, int x, int y, int w, int h)

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

@@ -135,6 +135,8 @@
 void fb_fini(void);
 u_int32_t fb_colour(int r, int g, int b);
 void fb_putpixel(int px, int py, int colour);
+int fb_composite(u_int32_t *dbuf, int dwidth, int dheight, int x, int y,
+    const u_int32_t *sbuf, int swidth, int sheight);
 void fb_fill(int col);
 void fb_fill_region(u_int32_t colour, int x, int y, int w, int h);
 void fb_fill_buf(u_int32_t *buf, u_int32_t color, int width, int height);


More information about the p4-projects mailing list