Index: [thread] [date] [subject] [author]
  From: Marcus Sundberg <mackan@stacken.kth.se>
  To  : ggi-develop@eskimo.com
  Date: Thu, 18 Feb 1999 22:21:42 +0000

Re: New function ggiFlushRegion()

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;
	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);
}

//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]