Modulate color shader's alpha with paint alpha when setting up gpu paint (fixes SampleTinyBitmap) 

Review URL: http://codereview.appspot.com/4648076/



git-svn-id: http://skia.googlecode.com/svn/trunk@1828 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 508ace0..d6ee03d 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -490,7 +490,9 @@
         if (SkShader::kColor_GradientType == shader->asAGradient(&info)) {
             SkPaint copy(skPaint);
             copy.setShader(NULL);
-            copy.setColor(SkColorSetA(color, copy.getAlpha()));
+            // modulate the paint alpha by the shader's solid color alpha
+            U8CPU newA = SkMulDiv255Round(SkColorGetA(color), copy.getAlpha());
+            copy.setColor(SkColorSetA(color, newA));
             return this->skPaint2GrPaintNoShader(copy,
                                                  false,
                                                  grPaint,