diff options
author | 2015-10-12 10:24:38 -0700 | |
---|---|---|
committer | 2015-10-12 10:24:38 -0700 | |
commit | 04965c6f112565c02926bc9a230e6da5f400d07a (patch) | |
tree | 3d941a02ef3d63dfd33d5762c01dded7c44c8af5 /dm/DMSrcSink.cpp | |
parent | 34422610ac22adceeabb66023120f27b96cae953 (diff) |
SkBitmapRegionDecoder clean-up
Use SkCodecPrintf instead of SkDebugf.
Check if the conversion is possible rather than starting many decodes
that will certainly fail.
Small refactor to code that deals with subsets that fall outside
of the image.
BUG=skia:
Review URL: https://codereview.chromium.org/1395383002
Diffstat (limited to 'dm/DMSrcSink.cpp')
-rw-r--r-- | dm/DMSrcSink.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp index 88371a8e28..c7b389d36d 100644 --- a/dm/DMSrcSink.cpp +++ b/dm/DMSrcSink.cpp @@ -114,6 +114,10 @@ Error BRDSrc::draw(SkCanvas* canvas) const { return Error::Nonfatal(SkStringPrintf("Could not create brd for %s.", fPath.c_str())); } + if (!brd->conversionSupported(colorType)) { + return Error::Nonfatal("Cannot convert to color type.\n"); + } + const uint32_t width = brd->width(); const uint32_t height = brd->height(); // Visually inspecting very small output images is not necessary. |