| 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 "SkBitmap.h" | 9 #include "SkBitmap.h" |
| 10 #include "SkCodec.h" | 10 #include "SkCodec.h" |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 DEF_TEST(Codec, r) { | 201 DEF_TEST(Codec, r) { |
| 202 // WBMP | 202 // WBMP |
| 203 check(r, "mandrill.wbmp", SkISize::Make(512, 512), true, false); | 203 check(r, "mandrill.wbmp", SkISize::Make(512, 512), true, false); |
| 204 | 204 |
| 205 // WEBP | 205 // WEBP |
| 206 check(r, "baby_tux.webp", SkISize::Make(386, 395), false, true); | 206 check(r, "baby_tux.webp", SkISize::Make(386, 395), false, true); |
| 207 check(r, "color_wheel.webp", SkISize::Make(128, 128), false, true); | 207 check(r, "color_wheel.webp", SkISize::Make(128, 128), false, true); |
| 208 check(r, "yellow_rose.webp", SkISize::Make(400, 301), false, true); | 208 check(r, "yellow_rose.webp", SkISize::Make(400, 301), false, true); |
| 209 | 209 |
| 210 // BMP | 210 // BMP |
| 211 check(r, "randPixels.bmp", SkISize::Make(8, 8), false, false); | 211 check(r, "randPixels.bmp", SkISize::Make(8, 8), true, false); |
| 212 | 212 |
| 213 // ICO | 213 // ICO |
| 214 // These two tests examine interestingly different behavior: | 214 // These two tests examine interestingly different behavior: |
| 215 // Decodes an embedded BMP image | 215 // Decodes an embedded BMP image |
| 216 check(r, "color_wheel.ico", SkISize::Make(128, 128), false, false); | 216 check(r, "color_wheel.ico", SkISize::Make(128, 128), false, false); |
| 217 // Decodes an embedded PNG image | 217 // Decodes an embedded PNG image |
| 218 check(r, "google_chrome.ico", SkISize::Make(256, 256), false, false); | 218 check(r, "google_chrome.ico", SkISize::Make(256, 256), false, false); |
| 219 | 219 |
| 220 // GIF | 220 // GIF |
| 221 check(r, "box.gif", SkISize::Make(200, 55), false, false); | 221 check(r, "box.gif", SkISize::Make(200, 55), false, false); |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 REPORTER_ASSERT(r, SkCodec::kInvalidParameters == result); | 367 REPORTER_ASSERT(r, SkCodec::kInvalidParameters == result); |
| 368 result = decoder->start( | 368 result = decoder->start( |
| 369 decoder->getInfo().makeColorType(kIndex_8_SkColorType)); | 369 decoder->getInfo().makeColorType(kIndex_8_SkColorType)); |
| 370 REPORTER_ASSERT(r, SkCodec::kInvalidParameters == result); | 370 REPORTER_ASSERT(r, SkCodec::kInvalidParameters == result); |
| 371 } | 371 } |
| 372 | 372 |
| 373 DEF_TEST(Codec_Params, r) { | 373 DEF_TEST(Codec_Params, r) { |
| 374 test_invalid_parameters(r, "index8.png"); | 374 test_invalid_parameters(r, "index8.png"); |
| 375 test_invalid_parameters(r, "mandrill.wbmp"); | 375 test_invalid_parameters(r, "mandrill.wbmp"); |
| 376 } | 376 } |
| OLD | NEW |