From: Geert U. <ge...@li...> - 2002-05-31 20:14:57
|
On Fri, 31 May 2002, James Simmons wrote: > > Secondly (not related to the topic), I was wondering if we can change > > the color value passed to fillrect and imageblit. Presently, the > > palette index is always passed regardless of the visual. Should the > > color value passed be reflective of the framebuffer format instead? > > Pass a palette index if pseudocolor, an RGB value for truecolor, etc. > > > > Doing the latter will simplify the low-level drawing function and at the > > same time, it will make the drawing functions more flexible -- ie, > > possiblity of exporting to userspace. > > We had this discussion sometime ago. We discovered it was just impossible > to handle all the possible different color formats in the higher levels. > We ended up with way to many #ifdefs. So it was decided to let the drivers > handle it instead. Actually if you wanted it to be useable to userland > then it makes even more sense to use the color map index instead. Think > about all the if() statements you would need in userland. Userland can easily set up function pointers, depending on the used format (for commonly used formats). Even for the generic case it can be done without too much loss of efficiency using look-up tables, cfr. fbtest. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@li... In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds |