| 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 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 for (uint32_t i = 0; i < numColorTypes; i++) { | 338 for (uint32_t i = 0; i < numColorTypes; i++) { |
| 339 push_codec_src(path, mode, colorTypes[i], scale); | 339 push_codec_src(path, mode, colorTypes[i], scale); |
| 340 } | 340 } |
| 341 } | 341 } |
| 342 } | 342 } |
| 343 | 343 |
| 344 // https://bug.skia.org/4428 | 344 // https://bug.skia.org/4428 |
| 345 bool subset = false; | 345 bool subset = false; |
| 346 // The following image types are supported by BitmapRegionDecoder, | 346 // The following image types are supported by BitmapRegionDecoder, |
| 347 // so we will test full image decodes and subset decodes. | 347 // so we will test full image decodes and subset decodes. |
| 348 static const char* const exts[] = { | 348 static const char* const subsetExts[] = { |
| 349 "jpg", "jpeg", "png", "webp", | 349 "jpg", "jpeg", "png", "webp", |
| 350 "JPG", "JPEG", "PNG", "WEBP", | 350 "JPG", "JPEG", "PNG", "WEBP", |
| 351 }; | 351 }; |
| 352 for (const char* ext : exts) { | 352 for (const char* ext : subsetExts) { |
| 353 if (path.endsWith(ext)) { | 353 if (path.endsWith(ext)) { |
| 354 subset = true; | 354 subset = true; |
| 355 break; | 355 break; |
| 356 } | 356 } |
| 357 } | 357 } |
| 358 | 358 |
| 359 bool full = false; |
| 360 // The following image types are only supported by BitmapFactory, |
| 361 // so we only need to test full image decodes. |
| 362 static const char* fullExts[] = { |
| 363 "wbmp", "bmp", "gif", |
| 364 "WBMP", "BMP", "GIF", |
| 365 }; |
| 366 for (const char* ext : fullExts) { |
| 367 if (path.endsWith(ext)) { |
| 368 full = true; |
| 369 break; |
| 370 } |
| 371 } |
| 372 |
| 373 if (!full && !subset) { |
| 374 return; |
| 375 } |
| 376 |
| 359 const int sampleSizes[] = { 1, 2, 3, 4, 5, 6, 7, 8 }; | 377 const int sampleSizes[] = { 1, 2, 3, 4, 5, 6, 7, 8 }; |
| 360 | 378 |
| 361 for (int sampleSize : sampleSizes) { | 379 for (int sampleSize : sampleSizes) { |
| 362 for (uint32_t i = 0; i < numColorTypes; i++) { | 380 for (uint32_t i = 0; i < numColorTypes; i++) { |
| 363 push_android_codec_src(path, AndroidCodecSrc::kFullImage_Mode, color
Types[i], | 381 push_android_codec_src(path, AndroidCodecSrc::kFullImage_Mode, color
Types[i], |
| 364 sampleSize); | 382 sampleSize); |
| 365 if (subset) { | 383 if (subset) { |
| 366 push_android_codec_src(path, AndroidCodecSrc::kDivisor_Mode, col
orTypes[i], | 384 push_android_codec_src(path, AndroidCodecSrc::kDivisor_Mode, col
orTypes[i], |
| 367 sampleSize); | 385 sampleSize); |
| 368 } | 386 } |
| (...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1186 Reporter* reporter, | 1204 Reporter* reporter, |
| 1187 GrContextFactory* fac
tory); | 1205 GrContextFactory* fac
tory); |
| 1188 } // namespace skiatest | 1206 } // namespace skiatest |
| 1189 | 1207 |
| 1190 #if !defined(SK_BUILD_FOR_IOS) | 1208 #if !defined(SK_BUILD_FOR_IOS) |
| 1191 int main(int argc, char** argv) { | 1209 int main(int argc, char** argv) { |
| 1192 SkCommandLineFlags::Parse(argc, argv); | 1210 SkCommandLineFlags::Parse(argc, argv); |
| 1193 return dm_main(); | 1211 return dm_main(); |
| 1194 } | 1212 } |
| 1195 #endif | 1213 #endif |
| OLD | NEW |