diff options
author | 2014-08-05 07:37:26 -0700 | |
---|---|---|
committer | 2014-08-05 07:37:27 -0700 | |
commit | e90c900ed7b2be3d0f9c7134d7fcd5f820b0464c (patch) | |
tree | dfb26735c967ec8763b50b9ed5e7a83889cd0970 /src/images/SkImageDecoder_pkm.cpp | |
parent | 72336ed7e16d2672543e0ceca9ddb843c63c8df6 (diff) |
Add ETC1 format to SkTextureCompressor
R=robertphillips@google.com
Author: krajcevski@google.com
Review URL: https://codereview.chromium.org/432143002
Diffstat (limited to 'src/images/SkImageDecoder_pkm.cpp')
-rw-r--r-- | src/images/SkImageDecoder_pkm.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/images/SkImageDecoder_pkm.cpp b/src/images/SkImageDecoder_pkm.cpp index 738d98ec29..f5fd4b3fbc 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; } |