shaders.
BUG=https://code.google.com/p/chromium/issues/detail?id=173657
Review URL: https://codereview.appspot.com/7220074
git-svn-id: http://skia.googlecode.com/svn/trunk@7517
2bbb7eff-a529-9590-31e7-
b0007b416f81
SkShader* shader = paint.getShader();
if (shader) {
SkBitmap bm;
- if (shader->asABitmap(&bm, NULL, NULL)) {
+ // Check whether the shader is a gradient in order to short-circuit
+ // call to asABitmap to prevent generation of bitmaps from
+ // gradient shaders, which implement asABitmap.
+ if (SkShader::kNone_GradientType == shader->asAGradient(NULL) &&
+ shader->asABitmap(&bm, NULL, NULL)) {
fPRSet->add(bm.pixelRef());
}
}