Index: dm/DMSrcSink.cpp |
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp |
index f4c8956b25505ad5f486baaeecb6eb6c6f50ee84..13c81f581d3b86170fa7d1e2243b5a488fa496b9 100644 |
--- a/dm/DMSrcSink.cpp |
+++ b/dm/DMSrcSink.cpp |
@@ -853,8 +853,15 @@ Error ColorCodecSrc::draw(SkCanvas* canvas) const { |
return Error::Nonfatal("No need to test color correction to 565 backend."); |
} |
- if (nullptr == canvas->imageInfo().colorSpace() && kRGBA_F16_SkColorType == fColorType) { |
- return Error::Nonfatal("F16 does not draw in legacy mode."); |
+ bool runInLegacyMode = kBaseline_Mode == fMode; |
+#if defined(SK_TEST_QCMS) |
+ runInLegacyMode = runInLegacyMode || kQCMS_HPZR30w_Mode == fMode; |
+#endif |
+ |
+ if (runInLegacyMode && canvas->imageInfo().colorSpace()) { |
+ return Error::Nonfatal("Skipping tests that are only interesting in legacy mode."); |
+ } else if (!runInLegacyMode && !canvas->imageInfo().colorSpace()) { |
+ return Error::Nonfatal("Skipping tests that are only interesting in srgb mode."); |
} |
SkAutoTUnref<SkData> encoded(SkData::NewFromFileName(fPath.c_str())); |
@@ -882,6 +889,10 @@ Error ColorCodecSrc::draw(SkCanvas* canvas) const { |
} |
SkImageInfo decodeInfo = codec->getInfo().makeColorType(fColorType).makeColorSpace(dstSpace); |
+ if (kUnpremul_SkAlphaType == decodeInfo.alphaType()) { |
+ decodeInfo = decodeInfo.makeAlphaType(kPremul_SkAlphaType); |
+ } |
+ |
SkImageInfo bitmapInfo = decodeInfo; |
if (kRGBA_8888_SkColorType == decodeInfo.colorType() || |
kBGRA_8888_SkColorType == decodeInfo.colorType()) |
@@ -910,6 +921,10 @@ Error ColorCodecSrc::draw(SkCanvas* canvas) const { |
#if defined(SK_TEST_QCMS) |
case kQCMS_HPZR30w_Mode: { |
sk_sp<SkData> srcData = codec->getICCData(); |
+ if (!srcData) { |
+ return Error::Nonfatal("No ICC profile data. Cannot test with QCMS.\n"); |
+ } |
+ |
SkAutoTCallVProc<qcms_profile, qcms_profile_release> |
srcSpace(qcms_profile_from_memory(srcData->data(), srcData->size())); |
if (!srcSpace) { |