diff options
author | skia.committer@gmail.com <skia.committer@gmail.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-05-23 03:03:34 +0000 |
---|---|---|
committer | skia.committer@gmail.com <skia.committer@gmail.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-05-23 03:03:34 +0000 |
commit | 7693dbf46e9bf0159cc9032059738d418469a7ad (patch) | |
tree | 84d73470b6e81a2945c8d701a3aecc2dfdd9f4ba /src/images | |
parent | ba7aedd6eac1e48e1902f81fa8ea93bb28a81c5f (diff) |
Sanitizing source files in Housekeeper-Nightly
git-svn-id: http://skia.googlecode.com/svn/trunk@14862 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/images')
-rw-r--r-- | src/images/SkImageDecoder_pkm.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/images/SkImageDecoder_pkm.cpp b/src/images/SkImageDecoder_pkm.cpp index 07f162b4e9..3d843ddf25 100644 --- a/src/images/SkImageDecoder_pkm.cpp +++ b/src/images/SkImageDecoder_pkm.cpp @@ -38,7 +38,7 @@ bool SkPKMImageDecoder::onDecode(SkStream* stream, SkBitmap* bm, Mode mode) { } unsigned char* buf = (unsigned char*)autoMal.get(); - + // Make sure original PKM header is there... SkASSERT(etc1_pkm_is_valid(buf)); @@ -49,27 +49,27 @@ bool SkPKMImageDecoder::onDecode(SkStream* stream, SkBitmap* bm, Mode mode) { if (!this->chooseFromOneChoice(SkBitmap::kARGB_8888_Config, width, height)) { return false; } - + bm->setConfig(SkBitmap::kARGB_8888_Config, width, height, 0, kOpaque_SkAlphaType); if (SkImageDecoder::kDecodeBounds_Mode == mode) { return true; } - + if (!this->allocPixelRef(bm, NULL)) { return false; } - + // Lock the pixels, since we're about to write to them... SkAutoLockPixels alp(*bm); - + // Advance buffer past the header buf += ETC_PKM_HEADER_SIZE; - + // 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()); - + // Decode ETC1 if (etc1_decode_image(buf, outRGBDataPtr, width, height, 3, width*3)) { return false; @@ -85,7 +85,7 @@ bool SkPKMImageDecoder::onDecode(SkStream* stream, SkBitmap* bm, Mode mode) { *dst++ = 0xFF; // Opaque alpha... src += 3; } - + return true; } |