diff options
author | scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-04-25 18:29:32 +0000 |
---|---|---|
committer | scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-04-25 18:29:32 +0000 |
commit | 49ce11ba14b044d98c3a44e3b2c19903fcdabaa5 (patch) | |
tree | cabbe8585a49d6a3b738ad52ea2582ab01899acc /src | |
parent | bb6b5baa969c7158a75dcf1ff9c1d566deb58fad (diff) |
Use SkError for a bitmap that could not be decoded.
When recreating an SkPicture from an SkStream, use the
new error reporting system to report that an SkBitmap
could not be decoded.
Add a test that the parse error is thrown.
Review URL: https://codereview.chromium.org/13892009
git-svn-id: http://skia.googlecode.com/svn/trunk@8866 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src')
-rw-r--r-- | src/core/SkOrderedReadBuffer.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/SkOrderedReadBuffer.cpp b/src/core/SkOrderedReadBuffer.cpp index 2c83ce0ac5..5a4cf96a92 100644 --- a/src/core/SkOrderedReadBuffer.cpp +++ b/src/core/SkOrderedReadBuffer.cpp @@ -7,6 +7,7 @@ */ #include "SkBitmap.h" +#include "SkErrorInternals.h" #include "SkOrderedReadBuffer.h" #include "SkStream.h" #include "SkTypeface.h" @@ -179,7 +180,8 @@ void SkOrderedReadBuffer::readBitmap(SkBitmap* bitmap) { } else { // This bitmap was encoded when written, but we are unable to decode, possibly due to // not having a decoder. Use a placeholder bitmap. - SkDebugf("Could not decode bitmap. Resulting bitmap will be red.\n"); + SkErrorInternals::SetError(kParseError_SkError, + "Could not decode bitmap. Resulting bitmap will be red."); bitmap->setConfig(SkBitmap::kARGB_8888_Config, width, height); bitmap->allocPixels(); bitmap->eraseColor(SK_ColorRED); |