Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(91)

Side by Side Diff: tests/ImageDecodingTest.cpp

Issue 234243002: Revert of Rename kPMColor_SkColorType to kN32_SkColorType. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tests/DrawBitmapRectTest.cpp ('k') | tests/ReadPixelsTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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 }
OLDNEW
« no previous file with comments | « tests/DrawBitmapRectTest.cpp ('k') | tests/ReadPixelsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698