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 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 // WBMP | 337 // WBMP |
338 check(r, "mandrill.wbmp", SkISize::Make(512, 512), true, false); | 338 check(r, "mandrill.wbmp", SkISize::Make(512, 512), true, false); |
339 | 339 |
340 // WEBP | 340 // WEBP |
341 check(r, "baby_tux.webp", SkISize::Make(386, 395), false, true); | 341 check(r, "baby_tux.webp", SkISize::Make(386, 395), false, true); |
342 check(r, "color_wheel.webp", SkISize::Make(128, 128), false, true); | 342 check(r, "color_wheel.webp", SkISize::Make(128, 128), false, true); |
343 check(r, "yellow_rose.webp", SkISize::Make(400, 301), false, true); | 343 check(r, "yellow_rose.webp", SkISize::Make(400, 301), false, true); |
344 | 344 |
345 // BMP | 345 // BMP |
346 check(r, "randPixels.bmp", SkISize::Make(8, 8), true, false); | 346 check(r, "randPixels.bmp", SkISize::Make(8, 8), true, false); |
| 347 check(r, "rle.bmp", SkISize::Make(320, 240), true, false); |
347 | 348 |
348 // ICO | 349 // ICO |
349 // FIXME: We are not ready to test incomplete ICOs | 350 // FIXME: We are not ready to test incomplete ICOs |
350 // These two tests examine interestingly different behavior: | 351 // These two tests examine interestingly different behavior: |
351 // Decodes an embedded BMP image | 352 // Decodes an embedded BMP image |
352 check(r, "color_wheel.ico", SkISize::Make(128, 128), true, false, false); | 353 check(r, "color_wheel.ico", SkISize::Make(128, 128), true, false, false); |
353 // Decodes an embedded PNG image | 354 // Decodes an embedded PNG image |
354 check(r, "google_chrome.ico", SkISize::Make(256, 256), true, false, false); | 355 check(r, "google_chrome.ico", SkISize::Make(256, 256), true, false, false); |
355 | 356 |
356 // GIF | 357 // GIF |
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
954 // Now test an image which is too big. Any image with a larger header (i.e. | 955 // Now test an image which is too big. Any image with a larger header (i.e. |
955 // has bigger width/height) is also too big. | 956 // has bigger width/height) is also too big. |
956 const unsigned char tooBigWbmp[] = { 0x00, 0x00, // Header | 957 const unsigned char tooBigWbmp[] = { 0x00, 0x00, // Header |
957 0x84, 0x80, 0x00, // W: 65536 | 958 0x84, 0x80, 0x00, // W: 65536 |
958 0x84, 0x80, 0x00 }; // H: 65536 | 959 0x84, 0x80, 0x00 }; // H: 65536 |
959 stream.reset(new SkMemoryStream(tooBigWbmp, sizeof(tooBigWbmp), false)); | 960 stream.reset(new SkMemoryStream(tooBigWbmp, sizeof(tooBigWbmp), false)); |
960 codec.reset(SkCodec::NewFromStream(stream.detach())); | 961 codec.reset(SkCodec::NewFromStream(stream.detach())); |
961 | 962 |
962 REPORTER_ASSERT(r, !codec); | 963 REPORTER_ASSERT(r, !codec); |
963 } | 964 } |
OLD | NEW |