pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/www/links



Module Name:    pkgsrc
Committed By:   nat
Date:           Sun Nov 15 20:36:38 UTC 2020

Modified Files:
        pkgsrc/www/links: distinfo
Added Files:
        pkgsrc/www/links/patches: patch-x.c

Log Message:
Add support for X servers at 1/2 bpp color depths.


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 pkgsrc/www/links/distinfo
cvs rdiff -u -r0 -r1.1 pkgsrc/www/links/patches/patch-x.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/www/links/distinfo
diff -u pkgsrc/www/links/distinfo:1.74 pkgsrc/www/links/distinfo:1.75
--- pkgsrc/www/links/distinfo:1.74      Wed Nov 13 21:32:40 2019
+++ pkgsrc/www/links/distinfo   Sun Nov 15 20:36:37 2020
@@ -1,7 +1,8 @@
-$NetBSD: distinfo,v 1.74 2019/11/13 21:32:40 wiz Exp $
+$NetBSD: distinfo,v 1.75 2020/11/15 20:36:37 nat Exp $
 
 SHA1 (links-2.20.2.tar.bz2) = dbcd36c9b37ba6340ce63bb77b7e1c2dec0cfdee
 RMD160 (links-2.20.2.tar.bz2) = ff974cc39235b5657d666ab75d7daf09b48b9997
 SHA512 (links-2.20.2.tar.bz2) = 82be459856f49f45c9b824589b78c0f58b039b09802e077420053e9449bc1ded272bb8ad57ea10522d8b3305ceb212a5dd08b01052538cd5b4f0447d0ba02152
 Size (links-2.20.2.tar.bz2) = 6474383 bytes
 SHA1 (patch-ab) = 3856b53ea6c17d72ca569acf1128ae40d2439ffb
+SHA1 (patch-x.c) = e4291e08437efd1147cfce88530fc662152df346

Added files:

Index: pkgsrc/www/links/patches/patch-x.c
diff -u /dev/null pkgsrc/www/links/patches/patch-x.c:1.1
--- /dev/null   Sun Nov 15 20:36:38 2020
+++ pkgsrc/www/links/patches/patch-x.c  Sun Nov 15 20:36:37 2020
@@ -0,0 +1,78 @@
+$NetBSD: patch-x.c,v 1.1 2020/11/15 20:36:37 nat Exp $
+Fix display for color depths lower than 4bpp.
+--- x.c.orig   2019-08-28 13:01:46.000000000 +0000
++++ x.c
+@@ -1663,12 +1663,12 @@ static unsigned char *x_init_driver(unsi
+ 
+       /* find best visual */
+       {
+-              static_const unsigned char depths[] = {24, 16, 15, 8, 4};
+-              static_const int classes[] = {TrueColor, PseudoColor, StaticColor}; /* FIXME: dodelat DirectColor */
++              static_const unsigned char depths[] = {24, 16, 15, 8, 4, 2, 1};
++              static_const int classes[] = {TrueColor, PseudoColor, StaticColor, StaticGray}; /* FIXME: dodelat DirectColor */
+               unsigned a, b;
+ 
+               for (a = 0; a < array_elements(depths); a++) for (b = 0; b < array_elements(classes); b++) {
+-                      if ((classes[b] == PseudoColor || classes[b] == StaticColor) && depths[a] > 8)
++                      if ((classes[b] == PseudoColor || classes[b] == StaticColor || classes[b] == StaticGray) && depths[a] > 8)
+                               continue;
+                       if (classes[b] == TrueColor && depths[a] <= 8)
+                               continue;
+@@ -1696,11 +1696,13 @@ bytes_per_pixel_found:
+                               /* test misordered flag */
+                               /*debug("x_depth %d, x_bitmap_bpp %d %lx %lx %lx %s", x_depth, x_bitmap_bpp, vinfo.red_mask, vinfo.green_mask, vinfo.blue_mask, x_bitmap_bit_order == MSBFirst ? 
"MSBFirst" : "LSBFirst");*/
+                               switch (x_depth) {
++                                      case 1:
++                                      case 2:
+                                       case 4:
+                                       case 8:
+                                               if (x_bitmap_bpp != 1)
+                                                       break;
+-                                              if (vinfo.class == StaticColor || vinfo.class == PseudoColor) {
++                                              if (vinfo.class == StaticColor || vinfo.class == PseudoColor || vinfo.class == StaticGray) {
+                                                       misordered = 0;
+                                                       goto visual_found;
+                                               }
+@@ -1755,7 +1757,7 @@ visual_found:
+       x_driver.flags &= ~GD_SWITCH_PALETTE;
+       x_have_palette = 0;
+       x_use_static_color_table = 0;
+-      if (vinfo.class == StaticColor) {
++      if (vinfo.class == StaticColor || vinfo.class == StaticGray) {
+               if (x_depth > 8)
+                       return stracpy(cast_uchar "Static color supported for up to 8-bit depth.\n");
+               if ((err = x_query_palette()))
+@@ -2219,13 +2221,32 @@ static void x_translate_colors(unsigned 
+               return;
+       }
+ 
++      unsigned char *mypic = data;
+       if (x_use_static_color_table) {
+               for (j = 0; j < y; j++) {
+                       for (i = 0; i < x; i++)
+                               data[i] = static_color_table[data[i]];
+                       data += skip;
+               }
+-              return;
++      }
++      if (x_depth == 1) {
++              unsigned char s;
++              for (j = 0; j < y; j++) {
++                      s = 0;
++                      for (i = 0; i < x; i++) {
++                              if (mypic[i])
++                                      s |= 1;
++                              if (i % 8 == 7) {
++                                      mypic[i / 8] = s;
++                                      s = 0;
++                              } else if (i == (x - 1)) {
++                                      s <<= (8 - ((i + 1) % 8));
++                                      mypic[i / 8] = s;
++                              } else
++                                      s <<= 1;
++                      }
++                      mypic += skip;
++              }
+       }
+ }
+ 



Home | Main Index | Thread Index | Old Index