[Vm-dev] [commit][3142] update of bitbltplugin.c .

commits at squeakvm.org commits at squeakvm.org
Fri Nov 21 03:52:03 UTC 2014


Revision: 3142
Author:   rowledge
Date:     2014-11-20 19:52:03 -0800 (Thu, 20 Nov 2014)
Log Message:
-----------
update of bitbltplugin.c . THis copy should rapidly get replaced by a fresh generated versionfor the new pixel/color compare prim

Modified Paths:
--------------
    branches/Cog/src/plugins/BitBltPlugin/BitBltPlugin.c

Modified: branches/Cog/src/plugins/BitBltPlugin/BitBltPlugin.c
===================================================================
--- branches/Cog/src/plugins/BitBltPlugin/BitBltPlugin.c	2014-11-21 03:42:26 UTC (rev 3141)
+++ branches/Cog/src/plugins/BitBltPlugin/BitBltPlugin.c	2014-11-21 03:52:03 UTC (rev 3142)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	SmartSyntaxPluginCodeGenerator VMMaker.oscog-eem.897 uuid: fcc5e4e2-808e-4ab1-97ae-079cc4b9d7b8
+	SmartSyntaxPluginCodeGenerator * VMMaker.oscog-eem.928 uuid: b54d1270-d8e4-42a0-b861-481cd83ac1a3
    from
-	BitBltSimulation VMMaker.oscog-eem.897 uuid: fcc5e4e2-808e-4ab1-97ae-079cc4b9d7b8
+	BitBltSimulation * VMMaker.oscog-eem.928 uuid: b54d1270-d8e4-42a0-b861-481cd83ac1a3
  */
-static char __buildInfo[] = "BitBltSimulation VMMaker.oscog-eem.897 uuid: fcc5e4e2-808e-4ab1-97ae-079cc4b9d7b8 " __DATE__ ;
+static char __buildInfo[] = "BitBltSimulation * VMMaker.oscog-eem.928 uuid: b54d1270-d8e4-42a0-b861-481cd83ac1a3 " __DATE__ ;
 
 
 
@@ -167,6 +167,7 @@
 static sqInt pixMaskwith(sqInt sourceWord, sqInt destinationWord);
 static sqInt pixPaintwith(sqInt sourceWord, sqInt destinationWord);
 static sqInt pixSwapwith(sqInt sourceWord, sqInt destWord);
+EXPORT(sqInt) primitiveCompareColors(void);
 EXPORT(sqInt) primitiveCopyBits(void);
 EXPORT(sqInt) primitiveDisplayString(void);
 EXPORT(sqInt) primitiveDrawLoop(void);
@@ -344,9 +345,9 @@
 };
 static const char *moduleName =
 #ifdef SQUEAK_BUILTIN_PLUGIN
-	"BitBltPlugin VMMaker.oscog-eem.897 (i)"
+	"BitBltPlugin * VMMaker.oscog-eem.928 (i)"
 #else
-	"BitBltPlugin VMMaker.oscog-eem.897 (e)"
+	"BitBltPlugin * VMMaker.oscog-eem.928 (e)"
 #endif
 ;
 static sqInt noHalftone;
@@ -3071,6 +3072,12 @@
 {
 	initBBOpTable();
 	initDither8Lookup();
+	
+#  if ENABLE_FAST_BLT
+	initialiseCopyBits();
+
+#  endif /* ENABLE_FAST_BLT */
+
 	return 1;
 }
 
@@ -5035,6 +5042,83 @@
 }
 
 
+/*	Invoke the pixel color comparing primitive.Only applicable if compiling
+	with ENABLE_FAST_BLT */
+
+EXPORT(sqInt)
+primitiveCompareColors(void)
+{
+	sqInt colorA;
+	sqInt colorB;
+	sqInt rcvr;
+	sqInt testID;
+	sqInt val;
+	sqInt _return_value;
+
+	colorA = stackIntegerValue(2);
+	colorB = stackIntegerValue(1);
+	testID = stackIntegerValue(0);
+	rcvr = stackValue(3);
+	if (failed()) {
+		return null;
+	}
+	
+#  if ENABLE_FAST_BLT
+	if (!(loadBitBltFromwarping(rcvr, 0))) {
+		primitiveFail();
+		return null;
+	}
+	clipRange();
+	if ((bbW <= 0)
+	 || (bbH <= 0)) {
+
+		/* zero width or height; noop */
+
+		primitiveFail();
+		return null;
+	}
+	
+	compare_operation_t op;
+	op.matchRule = testID & 3;
+	op.tally = testID & (1u<<3);
+	op.srcA.bits = (void *) sourceBits;
+	op.srcA.pitch = sourcePitch;
+	op.srcA.depth = sourceDepth;
+	op.srcA.msb = sourceMSB;
+	op.srcA.x = sx;
+	op.srcA.y = sy;
+	op.srcB.bits = (void *) destBits;
+	op.srcB.pitch = destPitch;
+	op.srcB.depth = destDepth;
+	op.srcB.msb = destMSB;
+	op.srcB.x = dx;
+	op.srcB.y = dy;
+	op.width = bbW;
+	op.height = bbH;
+	op.colorA = colorA;
+	op.colorB = colorB;
+
+	val = compareColorsDispatch(&op);
+	_return_value = positive32BitIntegerFor(val);
+	if (failed()) {
+		return null;
+	}
+	popthenPush(4, _return_value);
+	return null;
+
+#  else /* ENABLE_FAST_BLT */
+	primitiveFail();
+
+#  endif /* ENABLE_FAST_BLT */
+
+	if (failed()) {
+		return null;
+	}
+	pop(3);
+	return null;
+}
+
+
 /*	Invoke the copyBits primitive. If the destination is the display, then
 	copy it to the screen.
  */
@@ -8123,6 +8207,7 @@
 	{"BitBltPlugin", "initialiseModule", (void*)initialiseModule},
 	{"BitBltPlugin", "loadBitBltFrom", (void*)loadBitBltFrom},
 	{"BitBltPlugin", "moduleUnloaded", (void*)moduleUnloaded},
+	{"BitBltPlugin", "primitiveCompareColors\000\003", (void*)primitiveCompareColors},
 	{"BitBltPlugin", "primitiveCopyBits\000\003", (void*)primitiveCopyBits},
 	{"BitBltPlugin", "primitiveDisplayString\000\003", (void*)primitiveDisplayString},
 	{"BitBltPlugin", "primitiveDrawLoop\000\003", (void*)primitiveDrawLoop},
@@ -8135,6 +8220,7 @@
 #else /* ifdef SQ_BUILTIN_PLUGIN */
 
 signed char copyBitsAccessorDepth = 1;
+signed char primitiveCompareColorsAccessorDepth = 3;
 signed char primitiveCopyBitsAccessorDepth = 3;
 signed char primitiveDisplayStringAccessorDepth = 3;
 signed char primitiveDrawLoopAccessorDepth = 3;



More information about the Vm-dev mailing list