Index: src/images/SkImageDecoder_libwebp.cpp |
diff --git a/src/images/SkImageDecoder_libwebp.cpp b/src/images/SkImageDecoder_libwebp.cpp |
index 49d5bd1cca079653a3d7f014d300bb2638671b3c..517480665366dfa78231983e087b9a5ef8d728e6 100644 |
--- a/src/images/SkImageDecoder_libwebp.cpp |
+++ b/src/images/SkImageDecoder_libwebp.cpp |
@@ -547,6 +547,15 @@ static void Index8_To_RGB(const uint8_t* in, uint8_t* rgb, int width, |
} |
} |
+static void Alpha8_To_RGB(const uint8_t* in, uint8_t* rgb, int width, |
+ const SkPMColor* SK_RESTRICT ctable) { |
+ const uint8_t* SK_RESTRICT src = (const uint8_t*)in; |
+ for (int i = 0; i < width; ++i) { |
+ rgb[0] = rgb[1] = rgb[2] = *src++; |
+ rgb += 3; |
+ } |
+} |
+ |
static ScanlineImporter ChooseImporter(const SkBitmap::Config& config, |
bool hasAlpha, |
int* bpp) { |
@@ -573,6 +582,9 @@ static ScanlineImporter ChooseImporter(const SkBitmap::Config& config, |
case SkBitmap::kIndex8_Config: |
*bpp = 3; |
return Index8_To_RGB; |
+ case SkBitmap::kA8_Config: |
+ *bpp = 3; |
+ return Alpha8_To_RGB; |
default: |
return NULL; |
} |