Hi,

> > What is the difference between drawing to a pixmap's index data buffer, 
> > and drawing to a linear pixel buffer? I can see the former is used when 
> > drawing to priority maps, but what should be used if a gfx helper 
> > function is needed for visual buffers?
> 
> Actually, I guess that linear pixel buffers are what the graphics driver 
> uses for storage of picture data?

Yes. Drawing to the index data buffer is much more specific than drawing
to a linear pixel buffer; the latter could actually be used to implement
the former (maybe it is, I haven't checked).

A "linear" pixel buffer (terminology is borrowed from GGI) is a screen
buffer for which all (relevant) pixels may be accessed at the same time
(although possibly only after an explicit acquire and before an explicit
release), and which has the following properties:
  (i)   All pixels displayed on one screen line are stored consecutively
        in memory as byte sequence representations, with both the size and
        layout of the byte sequence and the distance between the pixels
        (often, but not always, the same as the size) constant.
  (ii)  Size, layout, and distance as used in (i) are identical for all
        lines.
  (iii) The distance in memory between lines is constant.
  (iv)  Pixels are stored from left to right with ascending memory
        addresses.
  (v)   Lines are stored from top to bottom with ascending memory
        addresses.

A formal definition would require some more terminology, but this is
probably more useful.
So far, any bitmap-based graphics system I have seen is built from linear
pixel buffers; the only exceptions being those that do "multi-heading"
(displaying on several screens/graphics cards/computers).

> > Why is there gfx_draw_box_pixmap_i() but not gfx_draw_box_buffer() ?

Because, so far, there hasn't been a need for the latter.
gfx_draw_box_pixmap_i() is used for control/priority maps (which are
stored as "color index" data, which allows us to later draw and display
them). gfx_draw_box_buffer() would have to be slightly more complex, since
it would first have to interpret the mode's color scheme, translate the
color into appropriate values, and then fill (not using memset in modes
using more than 8bpp).


llap,
 Christoph


Reply via email to