Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 7 Feb 2014 17:10:25 +0200
From:      Aleksandr Rybalko <ray@freebsd.org>
To:        Ed Schouten <ed@80386.nl>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r261585 - head/sys/dev/vt/hw/vga
Message-ID:  <20140207171025.d33b95770f6b0d7d00b4aab3@freebsd.org>
In-Reply-To: <CAJOYFBAAmcfrob4LsBC2jz6TxfNPd%2Bh6Np_dn7toOgXRZHAiow@mail.gmail.com>
References:  <201402071239.s17CdwIH007683@svn.freebsd.org> <CAJOYFBAAmcfrob4LsBC2jz6TxfNPd%2Bh6Np_dn7toOgXRZHAiow@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 7 Feb 2014 15:04:47 +0100
Ed Schouten <ed@80386.nl> wrote:

> Hi Aleksandr,
> 
> On 7 February 2014 13:39, Aleksandr Rybalko <ray@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@80386.nl>


-- 
Aleksandr Rybalko <ray@freebsd.org>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140207171025.d33b95770f6b0d7d00b4aab3>