If the user requested A8, but the source is not gray, switch to
ARGB8888.
BUG=https://b.corp.google.com/issue?id=9189955
R=reed@google.com
Review URL: https://codereview.chromium.org/
24882002
git-svn-id: http://skia.googlecode.com/svn/trunk@11573
2bbb7eff-a529-9590-31e7-
b0007b416f81
*configp = SkBitmap::kARGB_8888_Config;
}
} else {
- if (*configp != SkBitmap::kRGB_565_Config &&
- *configp != SkBitmap::kARGB_4444_Config &&
- *configp != SkBitmap::kA8_Config) {
+ if (SkBitmap::kA8_Config == *configp) {
+ if (k8BitGray_SrcDepth != srcDepth) {
+ // Converting a non grayscale image to A8 is not currently supported.
+ *configp = SkBitmap::kARGB_8888_Config;
+ }
+ } else if (*configp != SkBitmap::kRGB_565_Config &&
+ *configp != SkBitmap::kARGB_4444_Config) {
*configp = SkBitmap::kARGB_8888_Config;
}
}