diff options
author | bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-07-08 16:55:04 +0000 |
---|---|---|
committer | bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-07-08 16:55:04 +0000 |
commit | cd9cfd7de39f8e7696cdb6b72931294d9da7839f (patch) | |
tree | 5d802a4e24d528f7a9030b65d0b135d811e3ae96 /src/gpu | |
parent | ab9ec23b78186f25331666cb23141edee6cf97e6 (diff) |
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
Diffstat (limited to 'src/gpu')
-rw-r--r-- | src/gpu/SkGpuDevice.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp index 508ace0246..d6ee03d9c6 100644 --- a/src/gpu/SkGpuDevice.cpp +++ b/src/gpu/SkGpuDevice.cpp @@ -490,7 +490,9 @@ bool SkGpuDevice::skPaint2GrPaintShader(const SkPaint& skPaint, 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, |