Index: [thread] [date] [subject] [author]
  From: Marcus Sundberg <mackan@stacken.kth.se>
  To  : ggi-develop@eskimo.com
  Date: Fri, 19 Feb 1999 17:57:46 +0000

Re: New function ggiFlushRegion()

Hartmut Niemann wrote:
> 
> >
> > Aaron Gaudio wrote:
> > > Why not allow a buffering mechanism which can store the region flushes and then
> > > uses another function to commit the flushes, or in the case of region flushing
> > > not being supported, simply does a ggiFlush()?
> >
> > That would just mean extra work for applications.
> > Region flushing is always supported. It's just the internal
> > implementation that
> > differs between targets. This how the two functions are implemented:
> >
> > int ggiFlush(ggi_visual *vis)
> > {
> >         return vis->opdisplay->flush(vis, 0, 0, LIBGGI_X(vis),
> > LIBGGI_Y(vis), 1);
> > }
> >
> > int ggiFlushRegion(ggi_visual *vis, int x, int y, int w, int h)
> > {
> >       /* Do sanity check here so targets can assume correct values */
> >       if (x < 0) x = 0;
> >       else if (x > LIBGGI_X(vis)) return GGI_EARGINVAL;
> >       if (y < 0) x = 0;
> 
> y = 0;  ???

*blush*
Thanks!

> >       else if (y > LIBGGI_Y(vis)) return GGI_EARGINVAL;
> >       if (x + w > LIBGGI_X(vis)) w = LIBGGI_X(vis) - x;
> >       if (y + h > LIBGGI_Y(vis)) h = LIBGGI_Y(vis) - y;
> >
> >       return vis->opdisplay->flush(vis, x, y, w, h, 1);
> > }
> 
> Why do you fail on too large X values, but not on too small ones?
> wouldn't it be better to either clip all the time (then x>xvirtual simply
> returns 'GGI_EOK') or complain all the time?

Because on too small ones the request can still be exectuted, but
with too large values there's nothing to update.

//Marcus
-- 
-------------------------------+------------------------------------
        Marcus Sundberg        | http://www.stacken.kth.se/~mackan/
 Royal Institute of Technology |       Phone: +46 707 295404
       Stockholm, Sweden       |   E-Mail: mackan@stacken.kth.se

Index: [thread] [date] [subject] [author]