Index: src/images/SkImageDecoder_pkm.cpp |
diff --git a/src/images/SkImageDecoder_pkm.cpp b/src/images/SkImageDecoder_pkm.cpp |
index f5fd4b3fbcad54f7c2327b1c072159a97b0b1a73..746ae40c4c287a44839ad6d22d4fa84acd402742 100644 |
--- a/src/images/SkImageDecoder_pkm.cpp |
+++ b/src/images/SkImageDecoder_pkm.cpp |
@@ -24,7 +24,7 @@ public: |
} |
protected: |
- virtual bool onDecode(SkStream* stream, SkBitmap* bm, Mode) SK_OVERRIDE; |
+ virtual Result onDecode(SkStream* stream, SkBitmap* bm, Mode) SK_OVERRIDE; |
private: |
typedef SkImageDecoder INHERITED; |
@@ -32,11 +32,11 @@ private: |
///////////////////////////////////////////////////////////////////////////////////////// |
-bool SkPKMImageDecoder::onDecode(SkStream* stream, SkBitmap* bm, Mode mode) { |
+SkImageDecoder::Result SkPKMImageDecoder::onDecode(SkStream* stream, SkBitmap* bm, Mode mode) { |
SkAutoMalloc autoMal; |
const size_t length = SkCopyStreamToStorage(&autoMal, stream); |
if (0 == length) { |
- return false; |
+ return kFailure; |
} |
unsigned char* buf = (unsigned char*)autoMal.get(); |
@@ -50,7 +50,7 @@ bool SkPKMImageDecoder::onDecode(SkStream* stream, SkBitmap* bm, Mode mode) { |
#ifdef SK_SUPPORT_LEGACY_IMAGEDECODER_CHOOSER |
// should we allow the Chooser (if present) to pick a config for us??? |
if (!this->chooseFromOneChoice(kN32_SkColorType, width, height)) { |
- return false; |
+ return kFailure; |
} |
#endif |
@@ -61,18 +61,18 @@ bool SkPKMImageDecoder::onDecode(SkStream* stream, SkBitmap* bm, Mode mode) { |
bm->setInfo(SkImageInfo::MakeN32(sampler.scaledWidth(), sampler.scaledHeight(), |
kOpaque_SkAlphaType)); |
if (SkImageDecoder::kDecodeBounds_Mode == mode) { |
- return true; |
+ return kSuccess; |
} |
if (!this->allocPixelRef(bm, NULL)) { |
- return false; |
+ return kFailure; |
} |
// Lock the pixels, since we're about to write to them... |
SkAutoLockPixels alp(*bm); |
if (!sampler.begin(bm, SkScaledBitmapSampler::kRGB, *this)) { |
- return false; |
+ return kFailure; |
} |
// Advance buffer past the header |
@@ -86,7 +86,7 @@ bool SkPKMImageDecoder::onDecode(SkStream* stream, SkBitmap* bm, Mode mode) { |
// Decode ETC1 |
if (!SkTextureCompressor::DecompressBufferFromFormat( |
outRGBDataPtr, width*3, buf, width, height, SkTextureCompressor::kETC1_Format)) { |
- return false; |
+ return kFailure; |
} |
// Set each of the pixels... |
@@ -99,7 +99,7 @@ bool SkPKMImageDecoder::onDecode(SkStream* stream, SkBitmap* bm, Mode mode) { |
srcRow += sampler.srcDY() * srcRowBytes; |
} |
- return true; |
+ return kSuccess; |
} |
///////////////////////////////////////////////////////////////////////////////////////// |