Chromium Code Reviews| Index: dm/DM.cpp |
| diff --git a/dm/DM.cpp b/dm/DM.cpp |
| index 55563fef08997dcf08f941c733577e51d3103ff6..76799da11ef183e66bf887fc7c2f4f8ab806b400 100644 |
| --- a/dm/DM.cpp |
| +++ b/dm/DM.cpp |
| @@ -203,25 +203,37 @@ static void push_codec_srcs(Path path) { |
| return; |
| } |
| + // Choose scales for scaling tests |
| + const float scales[] = { 0.125f, 0.25f, 0.5f, 1.0f, 2.0f, 4.0f }; |
|
scroggo
2015/06/11 15:50:02
It looks we'll use 1.0f twice - once in kScale_Mod
msarett
2015/06/11 19:29:35
In the new design, scale is not a mode. Rather, e
|
| + |
| // Build additional test cases for images that decode natively to non-canvas types |
| switch(codec->getInfo().colorType()) { |
| case kGray_8_SkColorType: |
| push_src("image", "codec_kGray8", new CodecSrc(path, CodecSrc::kNormal_Mode, |
| - CodecSrc::kGrayscale_Always_DstColorType)); |
| + CodecSrc::kGrayscale_Always_DstColorType, 1.0f)); |
| push_src("image", "scanline_kGray8", new CodecSrc(path, CodecSrc::kScanline_Mode, |
| - CodecSrc::kGrayscale_Always_DstColorType)); |
| + CodecSrc::kGrayscale_Always_DstColorType, 1.0f)); |
| push_src("image", "scanline_subset_kGray8", new CodecSrc(path, |
| - CodecSrc::kScanline_Subset_Mode, CodecSrc::kGrayscale_Always_DstColorType)); |
| + CodecSrc::kScanline_Subset_Mode, CodecSrc::kGrayscale_Always_DstColorType, |
| + 1.0f)); |
| + for (float scale : scales) { |
| + push_src("image", "scale_kGray8", new CodecSrc(path, CodecSrc::kScale_Mode, |
| + CodecSrc::kGrayscale_Always_DstColorType, scale)); |
| + } |
| // Intentional fall through |
| // FIXME: Is this a long term solution for testing wbmps decodes to kIndex8? |
| // Further discussion on this topic is at skbug.com/3683 |
| case kIndex_8_SkColorType: |
| push_src("image", "codec_kIndex8", new CodecSrc(path, CodecSrc::kNormal_Mode, |
| - CodecSrc::kIndex8_Always_DstColorType)); |
| + CodecSrc::kIndex8_Always_DstColorType, 1.0f)); |
| push_src("image", "scanline_kIndex8", new CodecSrc(path, CodecSrc::kScanline_Mode, |
| - CodecSrc::kIndex8_Always_DstColorType)); |
| + CodecSrc::kIndex8_Always_DstColorType, 1.0f)); |
| push_src("image", "scanline_subset_kIndex8", new CodecSrc(path, |
| - CodecSrc::kScanline_Subset_Mode, CodecSrc::kIndex8_Always_DstColorType)); |
| + CodecSrc::kScanline_Subset_Mode, CodecSrc::kIndex8_Always_DstColorType, 1.0f)); |
| + for (float scale : scales) { |
| + push_src("image", "scale_kIndex8", new CodecSrc(path, CodecSrc::kScale_Mode, |
| + CodecSrc::kIndex8_Always_DstColorType, scale)); |
| + } |
| break; |
| default: |
| // Do nothing |
| @@ -230,11 +242,15 @@ static void push_codec_srcs(Path path) { |
| // Decode all images to the canvas color type |
| push_src("image", "codec", new CodecSrc(path, CodecSrc::kNormal_Mode, |
| - CodecSrc::kGetFromCanvas_DstColorType)); |
| + CodecSrc::kGetFromCanvas_DstColorType, 1.0f)); |
| push_src("image", "scanline", new CodecSrc(path, CodecSrc::kScanline_Mode, |
|
scroggo
2015/06/11 15:50:02
I could imagine that it might be useful to test sc
msarett
2015/06/11 19:29:35
I agree. The new patch tests scaling for all of t
|
| - CodecSrc::kGetFromCanvas_DstColorType)); |
| + CodecSrc::kGetFromCanvas_DstColorType, 1.0f)); |
| push_src("image", "scanline_subset", new CodecSrc(path, CodecSrc::kScanline_Subset_Mode, |
| - CodecSrc::kGetFromCanvas_DstColorType)); |
| + CodecSrc::kGetFromCanvas_DstColorType, 1.0f)); |
| + for (float scale : scales) { |
| + push_src("image", "scale", new CodecSrc(path, CodecSrc::kScale_Mode, |
| + CodecSrc::kGetFromCanvas_DstColorType, scale)); |
| + } |
| } |
| static bool codec_supported(const char* ext) { |