nanogui: GrReadArea for pixmaps


Previous by date: 3 Oct 2000 22:21:21 -0000 Re: Bug in srvclip2.c, peter.igelaus.com.au
Next by date: 3 Oct 2000 22:21:21 -0000 Re: GrReadArea for pixmaps, peter.igelaus.com.au
Previous in thread:
Next in thread: 3 Oct 2000 22:21:21 -0000 Re: GrReadArea for pixmaps, peter.igelaus.com.au

Subject: GrReadArea for pixmaps
From: ####@####.####
Date: 3 Oct 2000 22:21:21 -0000
Message-Id: <Pine.LNX.4.10.10010040914460.20259-200000@helios.devel.igelaus.com.au>

Good morning,
	Here is a diff (against .89pre1) that allows a GrReadArea on
pixmaps. This fixes some problems with composite images in Mozilla.

Enjoy

Peter Hartshorn

--- srvfunc.nopixmap	Wed Oct  4 09:14:13 2000
+++ srvfunc.c	Wed Oct  4 09:14:15 2000
@@ -1863,21 +1863,35 @@
 	GR_PIXELVAL *pixels)
 {
 	GR_WINDOW	*wp;
+	GR_PIXMAP	*pp;
 
-	wp = GsFindWindow(id);			/* FIXME- should check pixmap */
-	if ((wp == NULL) || wp->unmapcount || (x >= wp->width) ||
-	    (y >= wp->height) || (x + width <= 0) || (y + height <= 0)) {
-		/* long		count;
-		 * GR_PIXELVAL	black;
-		 *
-		 * black = GdFindColor(BLACK);
-		 * count = width * height;
-		 * while (count-- > 0)
-		 *	*pixels++ = black;
-		 */
+	wp = GsFindWindow(id);
+	pp = GsFindPixmap(id);
+	if ((wp == NULL) && (pp == NULL))
 		return;
+
+	if (wp != NULL) {
+		if (wp->unmapcount || (x >= wp->width) || (y >= wp->height) ||
+		   (x + width <= 0) || (y + height <= 0) {
+			/* long		count;
+			* GR_PIXELVAL	black;
+			*
+			* black = GdFindColor(BLACK);
+			* count = width * height;
+			* while (count-- > 0)
+			*	*pixels++ = black;
+			*/
+			return;
+		}
+		GdReadArea(wp->psd, wp->x, wp->y, width, height, pixels);
+	}
+	if (pp != NULL) {
+		if ((x >= pp->width) || (y >= pp->height) ||
+		    (x + width <= 0) || (y + height <= 0)) {
+			return;
+		}
+		GdReadArea(pp->psd, x, y, width, height, pixels);
 	}
-	GdReadArea(wp->psd, wp->x, wp->y, width, height, pixels);
 }
 
 /*

Previous by date: 3 Oct 2000 22:21:21 -0000 Re: Bug in srvclip2.c, peter.igelaus.com.au
Next by date: 3 Oct 2000 22:21:21 -0000 Re: GrReadArea for pixmaps, peter.igelaus.com.au
Previous in thread:
Next in thread: 3 Oct 2000 22:21:21 -0000 Re: GrReadArea for pixmaps, peter.igelaus.com.au


Powered by ezmlm-browse 0.20.