nanogui: bitblitting


Previous by date: 24 Oct 2000 00:41:57 -0000 Re: Frame buffer setting for ATI 3D RAGE AGP 2X?, 阿哲
Next by date: 24 Oct 2000 00:41:57 -0000 Re: [linuxce-devel] rzsz working partially on VTech Helio, Jay Carlson
Previous in thread:
Next in thread: 24 Oct 2000 00:41:57 -0000 bitblitting, Salvatore Jung

Subject: bitblitting
From: ####@####.####
Date: 24 Oct 2000 00:41:57 -0000
Message-Id: <Pine.LNX.4.10.10010241132100.4549-200000@helios.devel.igelaus.com.au>

Hello,
	While trying to improve the speed of NanoZilla, I found a problem
with the linear??_blit function. If we are blitting in the same window or
pixmap (ie the same memory address) and the destination x or y was within
the source rectangle, I would get repeated bands of the top of the image.
To fix this I've added a check to see if our destination y is within the
source rectangle, and if so blit from the bottom up. The problem in the x
direction was solved by replacing the memcpy command with the memmove
command which handles overlap.

This diff is only for fblin32.c but it illustrates how it can be done for
other depths.

From Peter Hartshorn.

--- /work/devel/microwin/src/drivers/fblin32.c	Fri Oct 13 10:55:33 2000
+++ fblin32.c	Tue Oct 24 11:31:31 2000
@@ -177,10 +177,17 @@
 	return;
 stdblit:
 #endif
+	if (srcy < dsty) {
+		src += (h-1) * slinelen;
+		dst += (h-1) * dlinelen;
+		slinelen *= -1;
+		dlinelen *= -1;
+	}
+
 	while(--h >= 0) {
 #if 1
-		/* a _fast_ memcpy is a _must_ in this routine*/
-		memcpy(dst, src, w<<2);
+		/* a _fast_ memmove is a _must_ in this routine*/
+		memmove(dst, src, w<<2);
 		dst += dlinelen;
 		src += slinelen;
 #else

Previous by date: 24 Oct 2000 00:41:57 -0000 Re: Frame buffer setting for ATI 3D RAGE AGP 2X?, 阿哲
Next by date: 24 Oct 2000 00:41:57 -0000 Re: [linuxce-devel] rzsz working partially on VTech Helio, Jay Carlson
Previous in thread:
Next in thread: 24 Oct 2000 00:41:57 -0000 bitblitting, Salvatore Jung


Powered by ezmlm-browse 0.20.