Index: src/ports/SkImageDecoder_CG.cpp |
diff --git a/src/ports/SkImageDecoder_CG.cpp b/src/ports/SkImageDecoder_CG.cpp |
index 3e3075cc1330feb4e2723290c7edef675b38174e..0358aec18c8c19b6c458c5e322f0a1cce5b0a851 100644 |
--- a/src/ports/SkImageDecoder_CG.cpp |
+++ b/src/ports/SkImageDecoder_CG.cpp |
@@ -48,7 +48,7 @@ static CGImageSourceRef SkStreamToCGImageSource(SkStream* stream) { |
class SkImageDecoder_CG : public SkImageDecoder { |
protected: |
- virtual bool onDecode(SkStream* stream, SkBitmap* bm, Mode); |
+ virtual Result onDecode(SkStream* stream, SkBitmap* bm, Mode); |
}; |
static void argb_4444_force_opaque(void* row, int count) { |
@@ -103,17 +103,17 @@ static void force_opaque(SkBitmap* bm) { |
#define BITMAP_INFO (kCGBitmapByteOrder32Big | kCGImageAlphaPremultipliedLast) |
-bool SkImageDecoder_CG::onDecode(SkStream* stream, SkBitmap* bm, Mode mode) { |
+SkImageDecoder::Result SkImageDecoder_CG::onDecode(SkStream* stream, SkBitmap* bm, Mode mode) { |
CGImageSourceRef imageSrc = SkStreamToCGImageSource(stream); |
if (NULL == imageSrc) { |
- return false; |
+ return kFailure; |
} |
SkAutoTCallVProc<const void, CFRelease> arsrc(imageSrc); |
CGImageRef image = CGImageSourceCreateImageAtIndex(imageSrc, 0, NULL); |
if (NULL == image) { |
- return false; |
+ return kFailure; |
} |
SkAutoTCallVProc<CGImage, CGImageRelease> arimage(image); |
@@ -122,17 +122,17 @@ bool SkImageDecoder_CG::onDecode(SkStream* stream, SkBitmap* bm, Mode mode) { |
bm->setInfo(SkImageInfo::MakeN32Premul(width, height)); |
if (SkImageDecoder::kDecodeBounds_Mode == mode) { |
- return true; |
+ return kSuccess; |
} |
if (!this->allocPixelRef(bm, NULL)) { |
- return false; |
+ return kFailure; |
} |
SkAutoLockPixels alp(*bm); |
if (!SkCopyPixelsFromCGImage(bm->info(), bm->rowBytes(), bm->getPixels(), image)) { |
- return false; |
+ return kFailure; |
} |
CGImageAlphaInfo info = CGImageGetAlphaInfo(image); |
@@ -162,7 +162,7 @@ bool SkImageDecoder_CG::onDecode(SkStream* stream, SkBitmap* bm, Mode mode) { |
} |
bm->setAlphaType(kUnpremul_SkAlphaType); |
} |
- return true; |
+ return kSuccess; |
} |
/////////////////////////////////////////////////////////////////////////////// |