Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Nov 2012 01:24:29 GMT
From:      Brooks Davis <brooks@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 219789 for review
Message-ID:  <201211150124.qAF1OT7j030098@skunkworks.freebsd.org>

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

Change 219789 by brooks@brooks_zenith on 2012/11/15 01:24:13

	Add a new fb_rectangle primative to make it easy to draw boxes
	around things.

Affected files ...

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

Differences ...

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

@@ -386,6 +386,24 @@
 }
 
 void
+fb_rectangle(u_int32_t color, int thickness, int x, int y, int w, int h)
+{
+  int col, row;
+
+  for (row = 0; row < h; row++) {
+    if (row < thickness || row >= h - thickness)
+      for (col = 0; col < w; col++)
+        pfbp[(y + row) * fb_width + (x + col)] = color;
+    else {
+      for (col = 0; col < thickness; col++) {
+        pfbp[(y + row) * fb_width + (x + col)] = color;
+        pfbp[(y + row) * fb_width + (x + col + w - thickness)] = color;
+      }
+    }
+  }
+}
+
+void
 fb_fill_region(u_int32_t colour, int x, int y, int w, int h)
 {
   int col, row;

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

@@ -137,6 +137,8 @@
 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_rectangle(u_int32_t color, int thickness, int x, int y, int
+    width, int height);
 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);



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