diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-07-06 21:18:09 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-07-06 21:18:09 +0000 |
commit | 2be9e8b407624fa696854b78b407b97a01dbb703 (patch) | |
tree | 329ca5e8a73984307a32f232bfc3f30a0deeed03 /src/gpu | |
parent | f78e78da589678dde4a1e3ba62e8ba20df3aa080 (diff) |
ColorShaders report no bitmaps, but only a color_gradient, which we now detect
on the gpu side.
git-svn-id: http://skia.googlecode.com/svn/trunk@1810 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu')
-rw-r--r-- | src/gpu/SkGpuDevice.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp index 0f1872666a..b8cc2bb4ce 100644 --- a/src/gpu/SkGpuDevice.cpp +++ b/src/gpu/SkGpuDevice.cpp @@ -481,6 +481,21 @@ bool SkGpuDevice::skPaint2GrPaintShader(const SkPaint& skPaint, GrSamplerState::SampleMode sampleMode = sk_bmp_type_to_sample_mode[bmptype]; if (-1 == sampleMode) { + SkShader::GradientInfo info; + SkColor color; + + info.fColors = &color; + info.fColorOffsets = NULL; + info.fColorCount = 1; + if (SkShader::kColor_GradientType == shader->asAGradient(&info)) { + SkPaint copy(skPaint); + copy.setShader(NULL); + copy.setColor(SkColorSetA(color, copy.getAlpha())); + return this->skPaint2GrPaintNoShader(copy, + false, + grPaint, + constantColor); + } return false; } GrSamplerState* sampler = grPaint->getTextureSampler(kShaderTextureIdx); |