| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "CrashHandler.h" | 8 #include "CrashHandler.h" |
| 9 #include "DMJsonWriter.h" | 9 #include "DMJsonWriter.h" |
| 10 #include "DMSrcSink.h" | 10 #include "DMSrcSink.h" |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 return; | 208 return; |
| 209 } | 209 } |
| 210 | 210 |
| 211 // Choose scales for scaling tests. | 211 // Choose scales for scaling tests. |
| 212 // TODO (msarett): Add more scaling tests as we implement more flexible scal
ing. | 212 // TODO (msarett): Add more scaling tests as we implement more flexible scal
ing. |
| 213 // TODO (msarett): Implement scaling tests for SkImageDecoder in order to co
mpare with these | 213 // TODO (msarett): Implement scaling tests for SkImageDecoder in order to co
mpare with these |
| 214 // tests. SkImageDecoder supports downscales by integer fac
tors. | 214 // tests. SkImageDecoder supports downscales by integer fac
tors. |
| 215 const float scales[] = { 0.125f, 0.25f, 0.375f, 0.5f, 0.625f, 0.750f, 0.875f
, 1.0f }; | 215 const float scales[] = { 0.125f, 0.25f, 0.375f, 0.5f, 0.625f, 0.750f, 0.875f
, 1.0f }; |
| 216 | 216 |
| 217 for (float scale : scales) { | 217 for (float scale : scales) { |
| 218 if (scale != 1.0f && (path.endsWith(".webp") || path.endsWith(".WEBP")))
{ | |
| 219 // FIXME: skbug.com/4038 Scaling webp seems to leave some pixels uni
nitialized/ | |
| 220 // compute their colors based on uninitialized values. | |
| 221 continue; | |
| 222 } | |
| 223 // Build additional test cases for images that decode natively to non-ca
nvas types | 218 // Build additional test cases for images that decode natively to non-ca
nvas types |
| 224 switch(codec->getInfo().colorType()) { | 219 switch(codec->getInfo().colorType()) { |
| 225 case kGray_8_SkColorType: | 220 case kGray_8_SkColorType: |
| 226 push_src("image", "codec_kGray8", new CodecSrc(path, CodecSrc::k
Normal_Mode, | 221 push_src("image", "codec_kGray8", new CodecSrc(path, CodecSrc::k
Normal_Mode, |
| 227 CodecSrc::kGrayscale_Always_DstColorType, scale)); | 222 CodecSrc::kGrayscale_Always_DstColorType, scale)); |
| 228 push_src("image", "scanline_kGray8", new CodecSrc(path, CodecSrc
::kScanline_Mode, | 223 push_src("image", "scanline_kGray8", new CodecSrc(path, CodecSrc
::kScanline_Mode, |
| 229 CodecSrc::kGrayscale_Always_DstColorType, scale)); | 224 CodecSrc::kGrayscale_Always_DstColorType, scale)); |
| 230 push_src("image", "scanline_subset_kGray8", new CodecSrc(path, | 225 push_src("image", "scanline_subset_kGray8", new CodecSrc(path, |
| 231 CodecSrc::kScanline_Subset_Mode, CodecSrc::kGrayscale_Al
ways_DstColorType, | 226 CodecSrc::kScanline_Subset_Mode, CodecSrc::kGrayscale_Al
ways_DstColorType, |
| 232 scale)); | 227 scale)); |
| (...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 843 } | 838 } |
| 844 return 0; | 839 return 0; |
| 845 } | 840 } |
| 846 | 841 |
| 847 #if !defined(SK_BUILD_FOR_IOS) | 842 #if !defined(SK_BUILD_FOR_IOS) |
| 848 int main(int argc, char** argv) { | 843 int main(int argc, char** argv) { |
| 849 SkCommandLineFlags::Parse(argc, argv); | 844 SkCommandLineFlags::Parse(argc, argv); |
| 850 return dm_main(); | 845 return dm_main(); |
| 851 } | 846 } |
| 852 #endif | 847 #endif |
| OLD | NEW |