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 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 check(r, "color_wheel.webp", SkISize::Make(128, 128), false, true); | 394 check(r, "color_wheel.webp", SkISize::Make(128, 128), false, true); |
395 check(r, "yellow_rose.webp", SkISize::Make(400, 301), false, true); | 395 check(r, "yellow_rose.webp", SkISize::Make(400, 301), false, true); |
396 | 396 |
397 // BMP | 397 // BMP |
398 check(r, "randPixels.bmp", SkISize::Make(8, 8), true, false); | 398 check(r, "randPixels.bmp", SkISize::Make(8, 8), true, false); |
399 | 399 |
400 // ICO | 400 // ICO |
401 // FIXME: We are not ready to test incomplete ICOs | 401 // FIXME: We are not ready to test incomplete ICOs |
402 // These two tests examine interestingly different behavior: | 402 // These two tests examine interestingly different behavior: |
403 // Decodes an embedded BMP image | 403 // Decodes an embedded BMP image |
404 check(r, "color_wheel.ico", SkISize::Make(128, 128), true, false, false); | 404 check(r, "color_wheel.ico", SkISize::Make(128, 128), false, false, false); |
405 // Decodes an embedded PNG image | 405 // Decodes an embedded PNG image |
406 check(r, "google_chrome.ico", SkISize::Make(256, 256), true, false, false); | 406 check(r, "google_chrome.ico", SkISize::Make(256, 256), false, false, false); |
407 | 407 |
408 // GIF | 408 // GIF |
409 // FIXME: We are not ready to test incomplete GIFs | 409 // FIXME: We are not ready to test incomplete GIFs |
410 check(r, "box.gif", SkISize::Make(200, 55), true, false, false); | 410 check(r, "box.gif", SkISize::Make(200, 55), true, false, false); |
411 check(r, "color_wheel.gif", SkISize::Make(128, 128), true, false, false); | 411 check(r, "color_wheel.gif", SkISize::Make(128, 128), true, false, false); |
412 // randPixels.gif is too small to test incomplete | 412 // randPixels.gif is too small to test incomplete |
413 check(r, "randPixels.gif", SkISize::Make(8, 8), true, false, false); | 413 check(r, "randPixels.gif", SkISize::Make(8, 8), true, false, false); |
414 | 414 |
415 // JPG | 415 // JPG |
416 check(r, "CMYK.jpg", SkISize::Make(642, 516), true, false); | 416 check(r, "CMYK.jpg", SkISize::Make(642, 516), true, false); |
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
870 REPORTER_ASSERT(r, SkImageDecoder::DecodeMemory(data->data(), data->size(),
&bitmap)); | 870 REPORTER_ASSERT(r, SkImageDecoder::DecodeMemory(data->data(), data->size(),
&bitmap)); |
871 | 871 |
872 // So SkCodec should, too. | 872 // So SkCodec should, too. |
873 SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(data)); | 873 SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(data)); |
874 REPORTER_ASSERT(r, codec); | 874 REPORTER_ASSERT(r, codec); |
875 if (!codec) { | 875 if (!codec) { |
876 return; | 876 return; |
877 } | 877 } |
878 test_info(r, codec, codec->getInfo(), SkCodec::kSuccess, nullptr); | 878 test_info(r, codec, codec->getInfo(), SkCodec::kSuccess, nullptr); |
879 } | 879 } |
OLD | NEW |