Index: src/images/SkImageDecoder_pkm.cpp |
diff --git a/src/images/SkImageDecoder_pkm.cpp b/src/images/SkImageDecoder_pkm.cpp |
index 738d98ec292c5472dfb16b04fd452713a79d4f98..f5fd4b3fbcad54f7c2327b1c072159a97b0b1a73 100644 |
--- a/src/images/SkImageDecoder_pkm.cpp |
+++ b/src/images/SkImageDecoder_pkm.cpp |
@@ -10,6 +10,7 @@ |
#include "SkScaledBitmapSampler.h" |
#include "SkStream.h" |
#include "SkStreamPriv.h" |
+#include "SkTextureCompressor.h" |
#include "SkTypes.h" |
#include "etc1.h" |
@@ -80,10 +81,11 @@ bool SkPKMImageDecoder::onDecode(SkStream* stream, SkBitmap* bm, Mode mode) { |
// ETC1 Data is encoded as RGB pixels, so we should extract it as such |
int nPixels = width * height; |
SkAutoMalloc outRGBData(nPixels * 3); |
- etc1_byte *outRGBDataPtr = reinterpret_cast<etc1_byte *>(outRGBData.get()); |
+ uint8_t *outRGBDataPtr = reinterpret_cast<uint8_t *>(outRGBData.get()); |
// Decode ETC1 |
- if (etc1_decode_image(buf, outRGBDataPtr, width, height, 3, width*3)) { |
+ if (!SkTextureCompressor::DecompressBufferFromFormat( |
+ outRGBDataPtr, width*3, buf, width, height, SkTextureCompressor::kETC1_Format)) { |
return false; |
} |