svn commit: r261585 - head/sys/dev/vt/hw/vga

Aleksandr Rybalko ray at freebsd.org
Fri Feb 7 15:07:10 UTC 2014


On Fri, 7 Feb 2014 15:04:47 +0100
Ed Schouten <ed at 80386.nl> wrote:

> Hi Aleksandr,
> 
> On 7 February 2014 13:39, Aleksandr Rybalko <ray at freebsd.org> wrote:
> > +static void
> > +vga_setpixel(struct vt_device *vd, int x, int y, term_color_t color)
> > +{
> > +}
> > +
> > +static void
> > +vga_drawrect(struct vt_device *vd, int x1, int y1, int x2, int y2, int fill,
> > +    term_color_t color)
> > +{
> > +}
> > +
> >  static inline void
> >  vga_bitblt_draw(struct vt_device *vd, const uint8_t *src,
> >      u_long ldst, uint8_t shift, unsigned int width, unsigned int height,
> 
> My question is, why do the setpixel and drawrect functions take signed
> coordinates, whereas bitblt does not? Wouldn' it be better to use
> unsigned coordinates all over the place?

Theoretically unsigned a bit better, practically does not matter (+/-2G
or 4G). Using signed int we also can ask to draw object which is
partially out of screen.
(and strlen("int") < strlen("unsigned int") :)) 

If you have objections, let discuss it.

Also people asking me about advanced features of vt(9), like use
multiple displays. I'm not sure, but signed coordinates may help with
some things on that way (or makes more problems :) ).

> 
> Furthermore, I think it's a bit weird that vga_bitbltchr() contains
> explicit bounds checking. What happened there? I remember at one point
> in time, we had the nice invariant that vt(9) never attempted to draw
> outside of the display resolution. What caused us to give up on that?

Mouse cursor allowed to partially go out of screen, so we have to check
(or use special function for mouse cursor).

> 
> -- 
> Ed Schouten <ed at 80386.nl>


-- 
Aleksandr Rybalko <ray at freebsd.org>


More information about the svn-src-head mailing list