Fixes shadow colors with alpha value smaller that one. Results were too transparent.
authorjunov@google.com <junov@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Fri, 11 Mar 2011 16:45:00 +0000 (16:45 +0000)
committerjunov@google.com <junov@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Fri, 11 Mar 2011 16:45:00 +0000 (16:45 +0000)
code review: codereview.appspot.com/4267052
skia bug: 170

git-svn-id: http://skia.googlecode.com/svn/trunk@924 2bbb7eff-a529-9590-31e7-b0007b416f81

src/effects/SkBlurDrawLooper.cpp

index faaecb8..5089f59 100644 (file)
@@ -31,8 +31,11 @@ SkBlurDrawLooper::SkBlurDrawLooper(SkScalar radius, SkScalar dx, SkScalar dy,
 
     if (flags & kOverrideColor_BlurFlag)
     {
+        // Set alpha to 1 for the override since transparency will already
+        // be baked into the blurred mask.
+        SkColor opaqueColor = SkColorSetA(color, 255);
         //The SrcIn xfer mode will multiply 'color' by the incoming alpha
-        fColorFilter = SkColorFilter::CreateModeFilter(color, SkXfermode::kSrcIn_Mode);
+        fColorFilter = SkColorFilter::CreateModeFilter(opaqueColor, SkXfermode::kSrcIn_Mode);
     }
     else
     {