Index: dm/DMSrcSink.cpp |
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp |
index 9e9a77c27124e85350406c7e84ec3b2f8f5f0886..183375c7fcc2bea641183822708d5b2c6a29bdc1 100644 |
--- a/dm/DMSrcSink.cpp |
+++ b/dm/DMSrcSink.cpp |
@@ -80,7 +80,17 @@ Error CodecSrc::draw(SkCanvas* canvas) const { |
SkColorType canvasColorType = canvasInfo.colorType(); |
switch (fDstColorType) { |
case kIndex8_Always_DstColorType: |
+ if (kIndex_8_SkColorType != decodeInfo.colorType()) { |
scroggo
2015/04/10 17:19:05
I'd prefer just setting decodeInfo to use kIndex8,
msarett
2015/04/13 20:54:04
Completely agree. See my comment in DM.cpp.
|
+ return Error::Nonfatal("Cannot decode to kIndex8."); |
+ } |
+ if (kRGB_565_SkColorType == canvasColorType) { |
+ return Error::Nonfatal("Testing non-565 to 565 is uninteresting."); |
+ } |
+ break; |
case kGrayscale_Always_DstColorType: |
+ if (kGray_8_SkColorType != decodeInfo.colorType()) { |
+ return Error::Nonfatal("Cannot decode to kGray8."); |
+ } |
if (kRGB_565_SkColorType == canvasColorType) { |
return Error::Nonfatal("Testing non-565 to 565 is uninteresting."); |
} |