fbutil.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372
  1. /*
  2. * Copyright © 1998 Keith Packard
  3. *
  4. * Permission to use, copy, modify, distribute, and sell this software and its
  5. * documentation for any purpose is hereby granted without fee, provided that
  6. * the above copyright notice appear in all copies and that both that
  7. * copyright notice and this permission notice appear in supporting
  8. * documentation, and that the name of Keith Packard not be used in
  9. * advertising or publicity pertaining to distribution of the software without
  10. * specific, written prior permission. Keith Packard makes no
  11. * representations about the suitability of this software for any purpose. It
  12. * is provided "as is" without express or implied warranty.
  13. *
  14. * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  15. * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  16. * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  17. * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  18. * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  19. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  20. * PERFORMANCE OF THIS SOFTWARE.
  21. */
  22. #ifdef HAVE_DIX_CONFIG_H
  23. #include <dix-config.h>
  24. #endif
  25. #include "fb.h"
  26. FbBits
  27. fbReplicatePixel(Pixel p, int bpp)
  28. {
  29. FbBits b = p;
  30. b &= FbFullMask(bpp);
  31. while (bpp < FB_UNIT) {
  32. b |= b << bpp;
  33. bpp <<= 1;
  34. }
  35. return b;
  36. }
  37. void
  38. fbReduceRasterOp(int rop, FbBits fg, FbBits pm, FbBits * andp, FbBits * xorp)
  39. {
  40. FbBits and, xor;
  41. switch (rop) {
  42. default:
  43. case GXclear: /* 0 0 0 0 */
  44. and = 0;
  45. xor = 0;
  46. break;
  47. case GXand: /* 0 0 0 1 */
  48. and = fg;
  49. xor = 0;
  50. break;
  51. case GXandReverse: /* 0 0 1 0 */
  52. and = fg;
  53. xor = fg;
  54. break;
  55. case GXcopy: /* 0 0 1 1 */
  56. and = 0;
  57. xor = fg;
  58. break;
  59. case GXandInverted: /* 0 1 0 0 */
  60. and = ~fg;
  61. xor = 0;
  62. break;
  63. case GXnoop: /* 0 1 0 1 */
  64. and = FB_ALLONES;
  65. xor = 0;
  66. break;
  67. case GXxor: /* 0 1 1 0 */
  68. and = FB_ALLONES;
  69. xor = fg;
  70. break;
  71. case GXor: /* 0 1 1 1 */
  72. and = ~fg;
  73. xor = fg;
  74. break;
  75. case GXnor: /* 1 0 0 0 */
  76. and = ~fg;
  77. xor = ~fg;
  78. break;
  79. case GXequiv: /* 1 0 0 1 */
  80. and = FB_ALLONES;
  81. xor = ~fg;
  82. break;
  83. case GXinvert: /* 1 0 1 0 */
  84. and = FB_ALLONES;
  85. xor = FB_ALLONES;
  86. break;
  87. case GXorReverse: /* 1 0 1 1 */
  88. and = ~fg;
  89. xor = FB_ALLONES;
  90. break;
  91. case GXcopyInverted: /* 1 1 0 0 */
  92. and = 0;
  93. xor = ~fg;
  94. break;
  95. case GXorInverted: /* 1 1 0 1 */
  96. and = fg;
  97. xor = ~fg;
  98. break;
  99. case GXnand: /* 1 1 1 0 */
  100. and = fg;
  101. xor = FB_ALLONES;
  102. break;
  103. case GXset: /* 1 1 1 1 */
  104. and = 0;
  105. xor = FB_ALLONES;
  106. break;
  107. }
  108. and |= ~pm;
  109. xor &= pm;
  110. *andp = and;
  111. *xorp = xor;
  112. }
  113. #define O 0
  114. #define I FB_ALLONES
  115. const FbMergeRopRec FbMergeRopBits[16] = {
  116. {O, O, O, O}, /* clear 0x0 0 */
  117. {I, O, O, O}, /* and 0x1 src AND dst */
  118. {I, O, I, O}, /* andReverse 0x2 src AND NOT dst */
  119. {O, O, I, O}, /* copy 0x3 src */
  120. {I, I, O, O}, /* andInverted 0x4 NOT src AND dst */
  121. {O, I, O, O}, /* noop 0x5 dst */
  122. {O, I, I, O}, /* xor 0x6 src XOR dst */
  123. {I, I, I, O}, /* or 0x7 src OR dst */
  124. {I, I, I, I}, /* nor 0x8 NOT src AND NOT dst */
  125. {O, I, I, I}, /* equiv 0x9 NOT src XOR dst */
  126. {O, I, O, I}, /* invert 0xa NOT dst */
  127. {I, I, O, I}, /* orReverse 0xb src OR NOT dst */
  128. {O, O, I, I}, /* copyInverted 0xc NOT src */
  129. {I, O, I, I}, /* orInverted 0xd NOT src OR dst */
  130. {I, O, O, I}, /* nand 0xe NOT src OR NOT dst */
  131. {O, O, O, I}, /* set 0xf 1 */
  132. };
  133. /*
  134. * Stipple masks are independent of bit/byte order as long
  135. * as bitorder == byteorder. FB doesn't handle the case
  136. * where these differ
  137. */
  138. #define BitsMask(x,w) ((FB_ALLONES << ((x) & FB_MASK)) & \
  139. (FB_ALLONES >> ((FB_UNIT - ((x) + (w))) & FB_MASK)))
  140. #define Mask(x,w) BitsMask((x)*(w),(w))
  141. #define SelMask(b,n,w) ((((b) >> n) & 1) * Mask(n,w))
  142. #define C1(b,w) \
  143. (SelMask(b,0,w))
  144. #define C2(b,w) \
  145. (SelMask(b,0,w) | \
  146. SelMask(b,1,w))
  147. #define C4(b,w) \
  148. (SelMask(b,0,w) | \
  149. SelMask(b,1,w) | \
  150. SelMask(b,2,w) | \
  151. SelMask(b,3,w))
  152. #define C8(b,w) \
  153. (SelMask(b,0,w) | \
  154. SelMask(b,1,w) | \
  155. SelMask(b,2,w) | \
  156. SelMask(b,3,w) | \
  157. SelMask(b,4,w) | \
  158. SelMask(b,5,w) | \
  159. SelMask(b,6,w) | \
  160. SelMask(b,7,w))
  161. #if FB_UNIT == 16
  162. #define fbStipple16Bits 0
  163. #define fbStipple8Bits 0
  164. const FbBits fbStipple4Bits[16] = {
  165. C4(0, 4), C4(1, 4), C4(2, 4), C4(3, 4), C4(4, 4), C4(5, 4),
  166. C4(6, 4), C4(7, 4), C4(8, 4), C4(9, 4), C4(10, 4), C4(11, 4),
  167. C4(12, 4), C4(13, 4), C4(14, 4), C4(15, 4),
  168. };
  169. const FbBits fbStipple2Bits[4] = {
  170. C2(0, 8), C2(1, 8), C2(2, 8), C2(3, 8),
  171. };
  172. const FbBits fbStipple1Bits[2] = {
  173. C1(0, 16), C1(1, 16),
  174. };
  175. #endif
  176. #if FB_UNIT == 32
  177. #define fbStipple16Bits 0
  178. const FbBits fbStipple8Bits[256] = {
  179. C8(0, 4), C8(1, 4), C8(2, 4), C8(3, 4), C8(4, 4), C8(5, 4),
  180. C8(6, 4), C8(7, 4), C8(8, 4), C8(9, 4), C8(10, 4), C8(11, 4),
  181. C8(12, 4), C8(13, 4), C8(14, 4), C8(15, 4), C8(16, 4), C8(17, 4),
  182. C8(18, 4), C8(19, 4), C8(20, 4), C8(21, 4), C8(22, 4), C8(23, 4),
  183. C8(24, 4), C8(25, 4), C8(26, 4), C8(27, 4), C8(28, 4), C8(29, 4),
  184. C8(30, 4), C8(31, 4), C8(32, 4), C8(33, 4), C8(34, 4), C8(35, 4),
  185. C8(36, 4), C8(37, 4), C8(38, 4), C8(39, 4), C8(40, 4), C8(41, 4),
  186. C8(42, 4), C8(43, 4), C8(44, 4), C8(45, 4), C8(46, 4), C8(47, 4),
  187. C8(48, 4), C8(49, 4), C8(50, 4), C8(51, 4), C8(52, 4), C8(53, 4),
  188. C8(54, 4), C8(55, 4), C8(56, 4), C8(57, 4), C8(58, 4), C8(59, 4),
  189. C8(60, 4), C8(61, 4), C8(62, 4), C8(63, 4), C8(64, 4), C8(65, 4),
  190. C8(66, 4), C8(67, 4), C8(68, 4), C8(69, 4), C8(70, 4), C8(71, 4),
  191. C8(72, 4), C8(73, 4), C8(74, 4), C8(75, 4), C8(76, 4), C8(77, 4),
  192. C8(78, 4), C8(79, 4), C8(80, 4), C8(81, 4), C8(82, 4), C8(83, 4),
  193. C8(84, 4), C8(85, 4), C8(86, 4), C8(87, 4), C8(88, 4), C8(89, 4),
  194. C8(90, 4), C8(91, 4), C8(92, 4), C8(93, 4), C8(94, 4), C8(95, 4),
  195. C8(96, 4), C8(97, 4), C8(98, 4), C8(99, 4), C8(100, 4), C8(101, 4),
  196. C8(102, 4), C8(103, 4), C8(104, 4), C8(105, 4), C8(106, 4), C8(107, 4),
  197. C8(108, 4), C8(109, 4), C8(110, 4), C8(111, 4), C8(112, 4), C8(113, 4),
  198. C8(114, 4), C8(115, 4), C8(116, 4), C8(117, 4), C8(118, 4), C8(119, 4),
  199. C8(120, 4), C8(121, 4), C8(122, 4), C8(123, 4), C8(124, 4), C8(125, 4),
  200. C8(126, 4), C8(127, 4), C8(128, 4), C8(129, 4), C8(130, 4), C8(131, 4),
  201. C8(132, 4), C8(133, 4), C8(134, 4), C8(135, 4), C8(136, 4), C8(137, 4),
  202. C8(138, 4), C8(139, 4), C8(140, 4), C8(141, 4), C8(142, 4), C8(143, 4),
  203. C8(144, 4), C8(145, 4), C8(146, 4), C8(147, 4), C8(148, 4), C8(149, 4),
  204. C8(150, 4), C8(151, 4), C8(152, 4), C8(153, 4), C8(154, 4), C8(155, 4),
  205. C8(156, 4), C8(157, 4), C8(158, 4), C8(159, 4), C8(160, 4), C8(161, 4),
  206. C8(162, 4), C8(163, 4), C8(164, 4), C8(165, 4), C8(166, 4), C8(167, 4),
  207. C8(168, 4), C8(169, 4), C8(170, 4), C8(171, 4), C8(172, 4), C8(173, 4),
  208. C8(174, 4), C8(175, 4), C8(176, 4), C8(177, 4), C8(178, 4), C8(179, 4),
  209. C8(180, 4), C8(181, 4), C8(182, 4), C8(183, 4), C8(184, 4), C8(185, 4),
  210. C8(186, 4), C8(187, 4), C8(188, 4), C8(189, 4), C8(190, 4), C8(191, 4),
  211. C8(192, 4), C8(193, 4), C8(194, 4), C8(195, 4), C8(196, 4), C8(197, 4),
  212. C8(198, 4), C8(199, 4), C8(200, 4), C8(201, 4), C8(202, 4), C8(203, 4),
  213. C8(204, 4), C8(205, 4), C8(206, 4), C8(207, 4), C8(208, 4), C8(209, 4),
  214. C8(210, 4), C8(211, 4), C8(212, 4), C8(213, 4), C8(214, 4), C8(215, 4),
  215. C8(216, 4), C8(217, 4), C8(218, 4), C8(219, 4), C8(220, 4), C8(221, 4),
  216. C8(222, 4), C8(223, 4), C8(224, 4), C8(225, 4), C8(226, 4), C8(227, 4),
  217. C8(228, 4), C8(229, 4), C8(230, 4), C8(231, 4), C8(232, 4), C8(233, 4),
  218. C8(234, 4), C8(235, 4), C8(236, 4), C8(237, 4), C8(238, 4), C8(239, 4),
  219. C8(240, 4), C8(241, 4), C8(242, 4), C8(243, 4), C8(244, 4), C8(245, 4),
  220. C8(246, 4), C8(247, 4), C8(248, 4), C8(249, 4), C8(250, 4), C8(251, 4),
  221. C8(252, 4), C8(253, 4), C8(254, 4), C8(255, 4),
  222. };
  223. const FbBits fbStipple4Bits[16] = {
  224. C4(0, 8), C4(1, 8), C4(2, 8), C4(3, 8), C4(4, 8), C4(5, 8),
  225. C4(6, 8), C4(7, 8), C4(8, 8), C4(9, 8), C4(10, 8), C4(11, 8),
  226. C4(12, 8), C4(13, 8), C4(14, 8), C4(15, 8),
  227. };
  228. const FbBits fbStipple2Bits[4] = {
  229. C2(0, 16), C2(1, 16), C2(2, 16), C2(3, 16),
  230. };
  231. const FbBits fbStipple1Bits[2] = {
  232. C1(0, 32), C1(1, 32),
  233. };
  234. #endif
  235. #if FB_UNIT == 64
  236. const FbBits fbStipple16Bits[256] = {
  237. C8(0, 4), C8(1, 4), C8(2, 4), C8(3, 4), C8(4, 4), C8(5, 4),
  238. C8(6, 4), C8(7, 4), C8(8, 4), C8(9, 4), C8(10, 4), C8(11, 4),
  239. C8(12, 4), C8(13, 4), C8(14, 4), C8(15, 4), C8(16, 4), C8(17, 4),
  240. C8(18, 4), C8(19, 4), C8(20, 4), C8(21, 4), C8(22, 4), C8(23, 4),
  241. C8(24, 4), C8(25, 4), C8(26, 4), C8(27, 4), C8(28, 4), C8(29, 4),
  242. C8(30, 4), C8(31, 4), C8(32, 4), C8(33, 4), C8(34, 4), C8(35, 4),
  243. C8(36, 4), C8(37, 4), C8(38, 4), C8(39, 4), C8(40, 4), C8(41, 4),
  244. C8(42, 4), C8(43, 4), C8(44, 4), C8(45, 4), C8(46, 4), C8(47, 4),
  245. C8(48, 4), C8(49, 4), C8(50, 4), C8(51, 4), C8(52, 4), C8(53, 4),
  246. C8(54, 4), C8(55, 4), C8(56, 4), C8(57, 4), C8(58, 4), C8(59, 4),
  247. C8(60, 4), C8(61, 4), C8(62, 4), C8(63, 4), C8(64, 4), C8(65, 4),
  248. C8(66, 4), C8(67, 4), C8(68, 4), C8(69, 4), C8(70, 4), C8(71, 4),
  249. C8(72, 4), C8(73, 4), C8(74, 4), C8(75, 4), C8(76, 4), C8(77, 4),
  250. C8(78, 4), C8(79, 4), C8(80, 4), C8(81, 4), C8(82, 4), C8(83, 4),
  251. C8(84, 4), C8(85, 4), C8(86, 4), C8(87, 4), C8(88, 4), C8(89, 4),
  252. C8(90, 4), C8(91, 4), C8(92, 4), C8(93, 4), C8(94, 4), C8(95, 4),
  253. C8(96, 4), C8(97, 4), C8(98, 4), C8(99, 4), C8(100, 4), C8(101, 4),
  254. C8(102, 4), C8(103, 4), C8(104, 4), C8(105, 4), C8(106, 4), C8(107, 4),
  255. C8(108, 4), C8(109, 4), C8(110, 4), C8(111, 4), C8(112, 4), C8(113, 4),
  256. C8(114, 4), C8(115, 4), C8(116, 4), C8(117, 4), C8(118, 4), C8(119, 4),
  257. C8(120, 4), C8(121, 4), C8(122, 4), C8(123, 4), C8(124, 4), C8(125, 4),
  258. C8(126, 4), C8(127, 4), C8(128, 4), C8(129, 4), C8(130, 4), C8(131, 4),
  259. C8(132, 4), C8(133, 4), C8(134, 4), C8(135, 4), C8(136, 4), C8(137, 4),
  260. C8(138, 4), C8(139, 4), C8(140, 4), C8(141, 4), C8(142, 4), C8(143, 4),
  261. C8(144, 4), C8(145, 4), C8(146, 4), C8(147, 4), C8(148, 4), C8(149, 4),
  262. C8(150, 4), C8(151, 4), C8(152, 4), C8(153, 4), C8(154, 4), C8(155, 4),
  263. C8(156, 4), C8(157, 4), C8(158, 4), C8(159, 4), C8(160, 4), C8(161, 4),
  264. C8(162, 4), C8(163, 4), C8(164, 4), C8(165, 4), C8(166, 4), C8(167, 4),
  265. C8(168, 4), C8(169, 4), C8(170, 4), C8(171, 4), C8(172, 4), C8(173, 4),
  266. C8(174, 4), C8(175, 4), C8(176, 4), C8(177, 4), C8(178, 4), C8(179, 4),
  267. C8(180, 4), C8(181, 4), C8(182, 4), C8(183, 4), C8(184, 4), C8(185, 4),
  268. C8(186, 4), C8(187, 4), C8(188, 4), C8(189, 4), C8(190, 4), C8(191, 4),
  269. C8(192, 4), C8(193, 4), C8(194, 4), C8(195, 4), C8(196, 4), C8(197, 4),
  270. C8(198, 4), C8(199, 4), C8(200, 4), C8(201, 4), C8(202, 4), C8(203, 4),
  271. C8(204, 4), C8(205, 4), C8(206, 4), C8(207, 4), C8(208, 4), C8(209, 4),
  272. C8(210, 4), C8(211, 4), C8(212, 4), C8(213, 4), C8(214, 4), C8(215, 4),
  273. C8(216, 4), C8(217, 4), C8(218, 4), C8(219, 4), C8(220, 4), C8(221, 4),
  274. C8(222, 4), C8(223, 4), C8(224, 4), C8(225, 4), C8(226, 4), C8(227, 4),
  275. C8(228, 4), C8(229, 4), C8(230, 4), C8(231, 4), C8(232, 4), C8(233, 4),
  276. C8(234, 4), C8(235, 4), C8(236, 4), C8(237, 4), C8(238, 4), C8(239, 4),
  277. C8(240, 4), C8(241, 4), C8(242, 4), C8(243, 4), C8(244, 4), C8(245, 4),
  278. C8(246, 4), C8(247, 4), C8(248, 4), C8(249, 4), C8(250, 4), C8(251, 4),
  279. C8(252, 4), C8(253, 4), C8(254, 4), C8(255, 4),
  280. };
  281. const FbBits fbStipple8Bits[256] = {
  282. C8(0, 8), C8(1, 8), C8(2, 8), C8(3, 8), C8(4, 8), C8(5, 8),
  283. C8(6, 8), C8(7, 8), C8(8, 8), C8(9, 8), C8(10, 8), C8(11, 8),
  284. C8(12, 8), C8(13, 8), C8(14, 8), C8(15, 8), C8(16, 8), C8(17, 8),
  285. C8(18, 8), C8(19, 8), C8(20, 8), C8(21, 8), C8(22, 8), C8(23, 8),
  286. C8(24, 8), C8(25, 8), C8(26, 8), C8(27, 8), C8(28, 8), C8(29, 8),
  287. C8(30, 8), C8(31, 8), C8(32, 8), C8(33, 8), C8(34, 8), C8(35, 8),
  288. C8(36, 8), C8(37, 8), C8(38, 8), C8(39, 8), C8(40, 8), C8(41, 8),
  289. C8(42, 8), C8(43, 8), C8(44, 8), C8(45, 8), C8(46, 8), C8(47, 8),
  290. C8(48, 8), C8(49, 8), C8(50, 8), C8(51, 8), C8(52, 8), C8(53, 8),
  291. C8(54, 8), C8(55, 8), C8(56, 8), C8(57, 8), C8(58, 8), C8(59, 8),
  292. C8(60, 8), C8(61, 8), C8(62, 8), C8(63, 8), C8(64, 8), C8(65, 8),
  293. C8(66, 8), C8(67, 8), C8(68, 8), C8(69, 8), C8(70, 8), C8(71, 8),
  294. C8(72, 8), C8(73, 8), C8(74, 8), C8(75, 8), C8(76, 8), C8(77, 8),
  295. C8(78, 8), C8(79, 8), C8(80, 8), C8(81, 8), C8(82, 8), C8(83, 8),
  296. C8(84, 8), C8(85, 8), C8(86, 8), C8(87, 8), C8(88, 8), C8(89, 8),
  297. C8(90, 8), C8(91, 8), C8(92, 8), C8(93, 8), C8(94, 8), C8(95, 8),
  298. C8(96, 8), C8(97, 8), C8(98, 8), C8(99, 8), C8(100, 8), C8(101, 8),
  299. C8(102, 8), C8(103, 8), C8(104, 8), C8(105, 8), C8(106, 8), C8(107, 8),
  300. C8(108, 8), C8(109, 8), C8(110, 8), C8(111, 8), C8(112, 8), C8(113, 8),
  301. C8(114, 8), C8(115, 8), C8(116, 8), C8(117, 8), C8(118, 8), C8(119, 8),
  302. C8(120, 8), C8(121, 8), C8(122, 8), C8(123, 8), C8(124, 8), C8(125, 8),
  303. C8(126, 8), C8(127, 8), C8(128, 8), C8(129, 8), C8(130, 8), C8(131, 8),
  304. C8(132, 8), C8(133, 8), C8(134, 8), C8(135, 8), C8(136, 8), C8(137, 8),
  305. C8(138, 8), C8(139, 8), C8(140, 8), C8(141, 8), C8(142, 8), C8(143, 8),
  306. C8(144, 8), C8(145, 8), C8(146, 8), C8(147, 8), C8(148, 8), C8(149, 8),
  307. C8(150, 8), C8(151, 8), C8(152, 8), C8(153, 8), C8(154, 8), C8(155, 8),
  308. C8(156, 8), C8(157, 8), C8(158, 8), C8(159, 8), C8(160, 8), C8(161, 8),
  309. C8(162, 8), C8(163, 8), C8(164, 8), C8(165, 8), C8(166, 8), C8(167, 8),
  310. C8(168, 8), C8(169, 8), C8(170, 8), C8(171, 8), C8(172, 8), C8(173, 8),
  311. C8(174, 8), C8(175, 8), C8(176, 8), C8(177, 8), C8(178, 8), C8(179, 8),
  312. C8(180, 8), C8(181, 8), C8(182, 8), C8(183, 8), C8(184, 8), C8(185, 8),
  313. C8(186, 8), C8(187, 8), C8(188, 8), C8(189, 8), C8(190, 8), C8(191, 8),
  314. C8(192, 8), C8(193, 8), C8(194, 8), C8(195, 8), C8(196, 8), C8(197, 8),
  315. C8(198, 8), C8(199, 8), C8(200, 8), C8(201, 8), C8(202, 8), C8(203, 8),
  316. C8(204, 8), C8(205, 8), C8(206, 8), C8(207, 8), C8(208, 8), C8(209, 8),
  317. C8(210, 8), C8(211, 8), C8(212, 8), C8(213, 8), C8(214, 8), C8(215, 8),
  318. C8(216, 8), C8(217, 8), C8(218, 8), C8(219, 8), C8(220, 8), C8(221, 8),
  319. C8(222, 8), C8(223, 8), C8(224, 8), C8(225, 8), C8(226, 8), C8(227, 8),
  320. C8(228, 8), C8(229, 8), C8(230, 8), C8(231, 8), C8(232, 8), C8(233, 8),
  321. C8(234, 8), C8(235, 8), C8(236, 8), C8(237, 8), C8(238, 8), C8(239, 8),
  322. C8(240, 8), C8(241, 8), C8(242, 8), C8(243, 8), C8(244, 8), C8(245, 8),
  323. C8(246, 8), C8(247, 8), C8(248, 8), C8(249, 8), C8(250, 8), C8(251, 8),
  324. C8(252, 8), C8(253, 8), C8(254, 8), C8(255, 8),
  325. };
  326. const FbBits fbStipple4Bits[16] = {
  327. C4(0, 16), C4(1, 16), C4(2, 16), C4(3, 16), C4(4, 16), C4(5, 16),
  328. C4(6, 16), C4(7, 16), C4(8, 16), C4(9, 16), C4(10, 16), C4(11, 16),
  329. C4(12, 16), C4(13, 16), C4(14, 16), C4(15, 16),
  330. };
  331. const FbBits fbStipple2Bits[4] = {
  332. C2(0, 32), C2(1, 32), C2(2, 32), C2(3, 32),
  333. };
  334. #define fbStipple1Bits 0
  335. #endif
  336. const FbBits *const fbStippleTable[] = {
  337. 0,
  338. fbStipple1Bits,
  339. fbStipple2Bits,
  340. 0,
  341. fbStipple4Bits,
  342. 0,
  343. 0,
  344. 0,
  345. fbStipple8Bits,
  346. };