OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "Resources.h" | 8 #include "Resources.h" |
9 #include "SkAndroidCodec.h" | 9 #include "SkAndroidCodec.h" |
10 #include "SkBitmap.h" | 10 #include "SkBitmap.h" |
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 check(r, "mandrill_32.png", SkISize::Make(32, 32), true, false, false); | 445 check(r, "mandrill_32.png", SkISize::Make(32, 32), true, false, false); |
446 check(r, "mandrill_512.png", SkISize::Make(512, 512), true, false, false); | 446 check(r, "mandrill_512.png", SkISize::Make(512, 512), true, false, false); |
447 check(r, "mandrill_64.png", SkISize::Make(64, 64), true, false, false); | 447 check(r, "mandrill_64.png", SkISize::Make(64, 64), true, false, false); |
448 check(r, "plane.png", SkISize::Make(250, 126), true, false, false); | 448 check(r, "plane.png", SkISize::Make(250, 126), true, false, false); |
449 // FIXME: We are not ready to test incomplete interlaced pngs | 449 // FIXME: We are not ready to test incomplete interlaced pngs |
450 check(r, "plane_interlaced.png", SkISize::Make(250, 126), true, false, false
); | 450 check(r, "plane_interlaced.png", SkISize::Make(250, 126), true, false, false
); |
451 check(r, "randPixels.png", SkISize::Make(8, 8), true, false, false); | 451 check(r, "randPixels.png", SkISize::Make(8, 8), true, false, false); |
452 check(r, "yellow_rose.png", SkISize::Make(400, 301), true, false, false); | 452 check(r, "yellow_rose.png", SkISize::Make(400, 301), true, false, false); |
453 | 453 |
454 // RAW | 454 // RAW |
| 455 #if defined(SK_CODEC_DECODES_RAW) |
455 check(r, "sample_1mp.dng", SkISize::Make(600, 338), false, false, false); | 456 check(r, "sample_1mp.dng", SkISize::Make(600, 338), false, false, false); |
| 457 #endif |
456 } | 458 } |
457 | 459 |
458 // Test interlaced PNG in stripes, similar to DM's kStripe_Mode | 460 // Test interlaced PNG in stripes, similar to DM's kStripe_Mode |
459 DEF_TEST(Codec_stripes, r) { | 461 DEF_TEST(Codec_stripes, r) { |
460 const char * path = "plane_interlaced.png"; | 462 const char * path = "plane_interlaced.png"; |
461 SkAutoTDelete<SkStream> stream(resource(path)); | 463 SkAutoTDelete<SkStream> stream(resource(path)); |
462 if (!stream) { | 464 if (!stream) { |
463 SkDebugf("Missing resource '%s'\n", path); | 465 SkDebugf("Missing resource '%s'\n", path); |
464 } | 466 } |
465 | 467 |
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
965 // Now test an image which is too big. Any image with a larger header (i.e. | 967 // Now test an image which is too big. Any image with a larger header (i.e. |
966 // has bigger width/height) is also too big. | 968 // has bigger width/height) is also too big. |
967 const unsigned char tooBigWbmp[] = { 0x00, 0x00, // Header | 969 const unsigned char tooBigWbmp[] = { 0x00, 0x00, // Header |
968 0x84, 0x80, 0x00, // W: 65536 | 970 0x84, 0x80, 0x00, // W: 65536 |
969 0x84, 0x80, 0x00 }; // H: 65536 | 971 0x84, 0x80, 0x00 }; // H: 65536 |
970 stream.reset(new SkMemoryStream(tooBigWbmp, sizeof(tooBigWbmp), false)); | 972 stream.reset(new SkMemoryStream(tooBigWbmp, sizeof(tooBigWbmp), false)); |
971 codec.reset(SkCodec::NewFromStream(stream.detach())); | 973 codec.reset(SkCodec::NewFromStream(stream.detach())); |
972 | 974 |
973 REPORTER_ASSERT(r, !codec); | 975 REPORTER_ASSERT(r, !codec); |
974 } | 976 } |
OLD | NEW |