From a6398911174d5445456ecb2f5f4f0565db2f100b Mon Sep 17 00:00:00 2001 From: "junov@google.com" Date: Fri, 11 Mar 2011 16:45:00 +0000 Subject: [PATCH] Fixes shadow colors with alpha value smaller that one. Results were too transparent. 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 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/effects/SkBlurDrawLooper.cpp b/src/effects/SkBlurDrawLooper.cpp index faaecb84fb..5089f5926e 100644 --- a/src/effects/SkBlurDrawLooper.cpp +++ b/src/effects/SkBlurDrawLooper.cpp @@ -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 {