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

[FYI] Re: Colormap issues with mozilla on 8-bit screen



On Sunday 28 March 2004 21:48, Julian Gilbey wrote:
> I've got an interesting problem.  I've recently upgraded my XWindows
> packages and mozilla (all in unstable) from about a month ago, and now
> mozilla can't get a decent set of colo(u)rs.  I'm working on an 8-bit
> display :-/ and I remember Branden saying something a while back about
> possible issues with the XRENDER library hogging 6x6x6=216 of the
> available colo(u)rs.  Could this be part of this problem, and if so,
> is there a way to disable it at runtime to test this theory?
>
> Thanks,
>
>    Julian

 Hello Julian and list,

   although problem you had is probably resolved (?)
   by using option RenderColormapMode,
   i think it is a bug (severity wishlist) in mozilla,
   because it is easy to get a set of colours for an app,
     whether other apps allocated many (or all) colours or not;

 X has a 'default colormap' ;
    on pseudocolor (8bit read/write colormap) visuals (videocardmodes),
      programs can request  Xserver to
      give them an entry in that colormap for shared or private use,
    but if there are no free cells in default colormap, such request fails.

 Applications can also use a private colormap ;
    if they are unable to get needed colours from default colormap,
      then this is what they should do ;
    application then works (and looks) ok,
    but all windows that use a different colormap
      are shown with incorrect colours
      when app with private colormap has focus
      (usually not a little bit incorrect, but real colorbarf);
    inversely, when focus is on an app that does use default colormap,
      app that uses private colormap is displayed incorrectly.

 Colorbarf can be much reduced by choosing private colormap intelligently,
    so that colors in private colormap are
      as similar to those of default colormap as possible;
    app can simply create an array of colors it wants to use,
      most important ones first, and then
        for each arraycolour
           find index in default colormap that has nearest colour
           and mark that index as in-use
     then app specifies it's private colormap such that it
       has most important colours on same index in colormap (aka pixelvalue)
       as nearest colour in default colormap.
    app can choose colors freely here, it just reorders them for harmony.
 If less colours are needed than fit in a colormap,
   remaining colours in private colormap should be
     copies of those in default colormap.
 If whole colormap is needed, above algorithm is not very good,
   as it tends to shift mismatches to end of colormap ;
   a more holistic (slower) algorith would be better.

 Ability to create a harmonized private colormap depends on 
    default colormap having a reasonable set of colors.
   I experimented a bit with colormaps some time ago,
      and found that a ca. 64-element colormap can be surprisingly complete,
      although it can not be subtle.
   therefore i think it would be nice if
     debian's X would allocate a small standard palette by default.
 I also think that it would be nice if map-harmonizing code would be in xlib.

 Although supporting 8bpp is not needed by developers of X applications,
    it may still break many apps when X supports switching bpp of visual
    (but i dont know if and when they plan to do that),
    and i find it irritating that some (many?) apps Just Dont Work on 8bpp
    (without their manpages mentioning it),
    which is why i post my findings from looking into this colorbarf matter
      to what is probably most interested audience : debian-x ;
    i myself wont have any significant amount of time available for debian 
      until may at least, and when i do, other things have higher priority,
      so by time i get to do anything with this,
        8bit cards 'll be only seen in musea.
   
 Any comments are welcome !
 If you'lld like sample code of above algorithm (not extremely likely),
   or are interested in an attempt at a small  and
     generally usefull palette (number of greyish colors very arbitrary),
   i already got that, so please dont hesitate to ask.
 Thanks for providing me with X !

 have fun :-)!

   Siward

 P.S.  I also found an instance where colorbarf is beneficial :
        when playing xgalaga , rest of screen goes nearly completely black.

 ---------------------------------------------------------------------------

 The nice thing about porno on the web is that
   it shows parts of nature that would otherwise remain unknown.



Reply to: