tweaks to 16bit shaders
fix typo-bug in 4444 blend case



git-svn-id: http://skia.googlecode.com/svn/trunk@265 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/samplecode/SampleFillType.cpp b/samplecode/SampleFillType.cpp
index bb268cd..dd4ea1a 100644
--- a/samplecode/SampleFillType.cpp
+++ b/samplecode/SampleFillType.cpp
@@ -69,6 +69,7 @@
         const SkScalar scale = SkIntToScalar(5)/4;
 
         paint.setAntiAlias(false);
+        paint.setColor(0x8000FF00);
 
         showFour(canvas, SK_Scalar1, paint);
         canvas->translate(SkIntToScalar(450), 0);
diff --git a/src/core/SkBlitter_4444.cpp b/src/core/SkBlitter_4444.cpp
index cce94c5..736f8c3 100644
--- a/src/core/SkBlitter_4444.cpp
+++ b/src/core/SkBlitter_4444.cpp
@@ -112,7 +112,7 @@
         *dst = other + SkAlphaMulQ4(*dst, invScale);
         dst++;
     }
-    if (color & 1) {
+    if (count & 1) {
         *dst = color + SkAlphaMulQ4(*dst, invScale);
     }
 }
@@ -134,7 +134,7 @@
         tmp = SkExpand_4444(*dst) * invScale;
         *dst++ = SkCompact_4444((other + tmp) >> 4);
     }
-    if (color & 1) {
+    if (count & 1) {
         tmp = SkExpand_4444(*dst) * invScale;
         *dst = SkCompact_4444((color + tmp) >> 4);
     }
diff --git a/src/core/SkBlitter_RGB16.cpp b/src/core/SkBlitter_RGB16.cpp
index 3b8075f..3111655 100644
--- a/src/core/SkBlitter_RGB16.cpp
+++ b/src/core/SkBlitter_RGB16.cpp
@@ -351,20 +351,13 @@
 
 static inline void blend32_16_row(SkPMColor src, uint16_t dst[], int count) {
     SkASSERT(count > 0);
-#if 0
     uint32_t src_expand = pmcolor_to_expand16(src);
-    unsigned scale = (0xFF - SkGetPackedA32(src)) >> 3;
+    unsigned scale = SkAlpha255To256(0xFF - SkGetPackedA32(src)) >> 3;
     do {
         uint32_t dst_expand = SkExpand_rgb_16(*dst) * scale;
         *dst = SkCompact_rgb_16((src_expand + dst_expand) >> 5);
         dst += 1;
     } while (--count != 0);
-#else
-    do {
-        *dst = SkSrcOver32To16(src, *dst);
-        dst += 1;
-    } while (--count != 0);
-#endif
 }
 
 void SkRGB16_Blitter::blitH(int x, int y, int width) SK_RESTRICT {
diff --git a/src/core/SkCoreBlitters.h b/src/core/SkCoreBlitters.h
index 7da7cad..5e34685 100644
--- a/src/core/SkCoreBlitters.h
+++ b/src/core/SkCoreBlitters.h
@@ -128,7 +128,7 @@
         : INHERITED(device, paint) {}
     virtual void blitMask(const SkMask&, const SkIRect&);
     virtual void blitAntiH(int x, int y, const SkAlpha antialias[], const int16_t runs[]);
-    
+
 private:
     typedef SkARGB32_Opaque_Blitter INHERITED;
 };