[Vm-dev] [commit][3186]
bilinear scaling prim needs to set the correct alpha value for output
non-transparent pixels
commits at squeakvm.org
commits at squeakvm.org
Tue Dec 16 23:13:20 UTC 2014
Revision: 3186
Author: rowledge
Date: 2014-12-16 15:13:16 -0800 (Tue, 16 Dec 2014)
Log Message:
-----------
bilinear scaling prim needs to set the correct alpha value for output non-transparent pixels
Modified Paths:
--------------
branches/Cog/src/plugins/ScratchPlugin/ScratchPlugin.c
Modified: branches/Cog/src/plugins/ScratchPlugin/ScratchPlugin.c
===================================================================
--- branches/Cog/src/plugins/ScratchPlugin/ScratchPlugin.c 2014-12-15 20:44:57 UTC (rev 3185)
+++ branches/Cog/src/plugins/ScratchPlugin/ScratchPlugin.c 2014-12-16 23:13:16 UTC (rev 3186)
@@ -1,9 +1,9 @@
/* Automatically generated by
- VMPluginCodeGenerator VMMaker.oscog-eem.983 uuid: 4cdca841-6318-4c49-95de-8c47d0d7e91d
+ VMPluginCodeGenerator VMMaker.oscog-tpr.989 uuid: bf75a0a2-413c-4995-b0cc-ec065e10a2f2
from
- ScratchPlugin VMMaker.oscog-eem.983 uuid: 4cdca841-6318-4c49-95de-8c47d0d7e91d
+ ScratchPlugin VMMaker.oscog-tpr.989 uuid: bf75a0a2-413c-4995-b0cc-ec065e10a2f2
*/
-static char __buildInfo[] = "ScratchPlugin VMMaker.oscog-eem.983 uuid: 4cdca841-6318-4c49-95de-8c47d0d7e91d " __DATE__ ;
+static char __buildInfo[] = "ScratchPlugin VMMaker.oscog-tpr.989 uuid: bf75a0a2-413c-4995-b0cc-ec065e10a2f2 " __DATE__ ;
@@ -123,9 +123,9 @@
struct VirtualMachine* interpreterProxy;
static const char *moduleName =
#ifdef SQUEAK_BUILTIN_PLUGIN
- "ScratchPlugin VMMaker.oscog-eem.983 (i)"
+ "ScratchPlugin VMMaker.oscog-tpr.989 (i)"
#else
- "ScratchPlugin VMMaker.oscog-eem.983 (e)"
+ "ScratchPlugin VMMaker.oscog-tpr.989 (e)"
#endif
;
@@ -1847,6 +1847,11 @@
/* Scale using bilinear interpolation. */
+/* This version isn't really able to do much with full ARGB based images; the
+ A channel will be ignored and only fully transparent pixels will be
+ treated as transparent. The output pixel will be either fully transparent
+ or fully opaque.
+ */
EXPORT(sqInt)
primitiveScale(void)
@@ -1982,10 +1987,14 @@
t = (((w1 * ((((usqInt) p1) >> 8) & 0xFF)) + (w2 * ((((usqInt) p2) >> 8) & 0xFF))) + (w3 * ((((usqInt) p3) >> 8) & 0xFF))) + (w4 * ((((usqInt) p4) >> 8) & 0xFF));
outPix = outPix | (((((usqInt) t) >> 20) & 0xFF) << 8);
t = (((w1 * (p1 & 0xFF)) + (w2 * (p2 & 0xFF))) + (w3 * (p3 & 0xFF))) + (w4 * (p4 & 0xFF));
+
+ /* If the result is black, remember to make it Squeak-standard-fake-black */
+
outPix = outPix | ((((usqInt) t) >> 20) & 0xFF);
if (outPix == 0) {
outPix = 1;
}
+ outPix = outPix | 0xFF000000UL;
}
out[(outY * outW) + outX] = outPix;
inX += xIncr;
More information about the Vm-dev
mailing list