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 "SkBitmap.h" | 8 #include "SkBitmap.h" |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkColor.h" | 10 #include "SkColor.h" |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 #define kBackwards_SkColorType kBGRA_8888_SkColorType | 388 #define kBackwards_SkColorType kBGRA_8888_SkColorType |
389 #else | 389 #else |
390 #error "SK_*32_SHFIT values must correspond to BGRA or RGBA byte order" | 390 #error "SK_*32_SHFIT values must correspond to BGRA or RGBA byte order" |
391 #endif | 391 #endif |
392 | 392 |
393 static inline const char* SkColorType_to_string(SkColorType colorType) { | 393 static inline const char* SkColorType_to_string(SkColorType colorType) { |
394 switch(colorType) { | 394 switch(colorType) { |
395 case kAlpha_8_SkColorType: return "Alpha_8"; | 395 case kAlpha_8_SkColorType: return "Alpha_8"; |
396 case kRGB_565_SkColorType: return "RGB_565"; | 396 case kRGB_565_SkColorType: return "RGB_565"; |
397 case kARGB_4444_SkColorType: return "ARGB_4444"; | 397 case kARGB_4444_SkColorType: return "ARGB_4444"; |
398 case kN32_SkColorType: return "N32"; | 398 case kPMColor_SkColorType: return "PMColor"; |
399 case kBackwards_SkColorType: return "Backwards"; | 399 case kBackwards_SkColorType: return "Backwards"; |
400 case kIndex_8_SkColorType: return "Index_8"; | 400 case kIndex_8_SkColorType: return "Index_8"; |
401 default: return "ERROR"; | 401 default: return "ERROR"; |
402 } | 402 } |
403 } | 403 } |
404 | 404 |
405 static inline const char* options_colorType( | 405 static inline const char* options_colorType( |
406 const SkDecodingImageGenerator::Options& opts) { | 406 const SkDecodingImageGenerator::Options& opts) { |
407 if (opts.fUseRequestedColorType) { | 407 if (opts.fUseRequestedColorType) { |
408 return SkColorType_to_string(opts.fRequestedColorType); | 408 return SkColorType_to_string(opts.fRequestedColorType); |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
530 if (!sk_exists(directory.c_str())) { | 530 if (!sk_exists(directory.c_str())) { |
531 return; | 531 return; |
532 } | 532 } |
533 | 533 |
534 int scaleList[] = {1, 2, 3, 4}; | 534 int scaleList[] = {1, 2, 3, 4}; |
535 bool ditherList[] = {true, false}; | 535 bool ditherList[] = {true, false}; |
536 SkColorType colorList[] = { | 536 SkColorType colorList[] = { |
537 kAlpha_8_SkColorType, | 537 kAlpha_8_SkColorType, |
538 kRGB_565_SkColorType, | 538 kRGB_565_SkColorType, |
539 kARGB_4444_SkColorType, // Most decoders will fail on 4444. | 539 kARGB_4444_SkColorType, // Most decoders will fail on 4444. |
540 kN32_SkColorType | 540 kPMColor_SkColorType |
541 // Note that indexed color is left out of the list. Lazy | 541 // Note that indexed color is left out of the list. Lazy |
542 // decoding doesn't do indexed color. | 542 // decoding doesn't do indexed color. |
543 }; | 543 }; |
544 const bool useDataList[] = {true, false}; | 544 const bool useDataList[] = {true, false}; |
545 | 545 |
546 for (size_t fidx = 0; fidx < SK_ARRAY_COUNT(files); ++fidx) { | 546 for (size_t fidx = 0; fidx < SK_ARRAY_COUNT(files); ++fidx) { |
547 SkString path = SkOSPath::SkPathJoin(directory.c_str(), files[fidx]); | 547 SkString path = SkOSPath::SkPathJoin(directory.c_str(), files[fidx]); |
548 if (!sk_exists(path.c_str())) { | 548 if (!sk_exists(path.c_str())) { |
549 continue; | 549 continue; |
550 } | 550 } |
(...skipping 17 matching lines...) Expand all Loading... |
568 } | 568 } |
569 SkDecodingImageGenerator::Options options(scaleList[i], | 569 SkDecodingImageGenerator::Options options(scaleList[i], |
570 ditherList[j]); | 570 ditherList[j]); |
571 test_options(reporter, options, encodedStream, encodedData, | 571 test_options(reporter, options, encodedStream, encodedData, |
572 useDataList[m], path); | 572 useDataList[m], path); |
573 } | 573 } |
574 } | 574 } |
575 } | 575 } |
576 } | 576 } |
577 } | 577 } |
OLD | NEW |