| OLD | NEW |
| 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 "Resources.h" | 8 #include "Resources.h" |
| 9 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
| 10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 0xffca00f3, 0xff605d47, 0xff446fb2, 0xff576e46, | 351 0xffca00f3, 0xff605d47, 0xff446fb2, 0xff576e46, |
| 352 0xff273df9, 0xffb41a83, 0xfff812c3, 0xffccab67, | 352 0xff273df9, 0xffb41a83, 0xfff812c3, 0xffccab67, |
| 353 0xff034218, 0xff7db9a7, 0xff821048, 0xfffe4ab4, | 353 0xff034218, 0xff7db9a7, 0xff821048, 0xfffe4ab4, |
| 354 0xff6fac98, 0xff941d27, 0xff5fe411, 0xfffbb283, | 354 0xff6fac98, 0xff941d27, 0xff5fe411, 0xfffbb283, |
| 355 0xffd86e99, 0xff169162, 0xff71128c, 0xff39cab4, | 355 0xffd86e99, 0xff169162, 0xff71128c, 0xff39cab4, |
| 356 0xffa7fe63, 0xff4c956b, 0xffbc22e0, 0xffb272e4, | 356 0xffa7fe63, 0xff4c956b, 0xffbc22e0, 0xffb272e4, |
| 357 0xff129f4a, 0xffe34513, 0xff3d3742, 0xffbd190a, | 357 0xff129f4a, 0xffe34513, 0xff3d3742, 0xffbd190a, |
| 358 0xffb07222, 0xff2e23f8, 0xfff089d9, 0xffb35738, | 358 0xffb07222, 0xff2e23f8, 0xfff089d9, 0xffb35738, |
| 359 0xffa86022, 0xff3340fe, 0xff95fe71, 0xff6a71df | 359 0xffa86022, 0xff3340fe, 0xff95fe71, 0xff6a71df |
| 360 }; | 360 }; |
| 361 SK_COMPILE_ASSERT((kExpectedWidth * kExpectedHeight) | 361 static_assert((kExpectedWidth * kExpectedHeight) == SK_ARRAY_COUNT(kExpectedPixe
ls), |
| 362 == SK_ARRAY_COUNT(kExpectedPixels), array_size_mismatch); | 362 "array_size_mismatch"); |
| 363 | 363 |
| 364 DEF_TEST(WebP, reporter) { | 364 DEF_TEST(WebP, reporter) { |
| 365 const unsigned char encodedWebP[] = { | 365 const unsigned char encodedWebP[] = { |
| 366 0x52, 0x49, 0x46, 0x46, 0x2c, 0x01, 0x00, 0x00, 0x57, 0x45, 0x42, 0x50, | 366 0x52, 0x49, 0x46, 0x46, 0x2c, 0x01, 0x00, 0x00, 0x57, 0x45, 0x42, 0x50, |
| 367 0x56, 0x50, 0x38, 0x4c, 0x20, 0x01, 0x00, 0x00, 0x2f, 0x07, 0xc0, 0x01, | 367 0x56, 0x50, 0x38, 0x4c, 0x20, 0x01, 0x00, 0x00, 0x2f, 0x07, 0xc0, 0x01, |
| 368 0x00, 0xff, 0x01, 0x45, 0x03, 0x00, 0xe2, 0xd5, 0xae, 0x60, 0x2b, 0xad, | 368 0x00, 0xff, 0x01, 0x45, 0x03, 0x00, 0xe2, 0xd5, 0xae, 0x60, 0x2b, 0xad, |
| 369 0xd9, 0x68, 0x76, 0xb6, 0x8d, 0x6a, 0x1d, 0xc0, 0xe6, 0x19, 0xd6, 0x16, | 369 0xd9, 0x68, 0x76, 0xb6, 0x8d, 0x6a, 0x1d, 0xc0, 0xe6, 0x19, 0xd6, 0x16, |
| 370 0xb7, 0xb4, 0xef, 0xcf, 0xc3, 0x15, 0x6c, 0xb3, 0xbd, 0x77, 0x0d, 0x85, | 370 0xb7, 0xb4, 0xef, 0xcf, 0xc3, 0x15, 0x6c, 0xb3, 0xbd, 0x77, 0x0d, 0x85, |
| 371 0x6d, 0x1b, 0xa9, 0xb1, 0x2b, 0xdc, 0x3d, 0x83, 0xdb, 0x00, 0x00, 0xc8, | 371 0x6d, 0x1b, 0xa9, 0xb1, 0x2b, 0xdc, 0x3d, 0x83, 0xdb, 0x00, 0x00, 0xc8, |
| 372 0x26, 0xe5, 0x01, 0x99, 0x8a, 0xd5, 0xdd, 0xfc, 0x82, 0xcd, 0xcd, 0x9a, | 372 0x26, 0xe5, 0x01, 0x99, 0x8a, 0xd5, 0xdd, 0xfc, 0x82, 0xcd, 0xcd, 0x9a, |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 746 ((void*)pixels.get(), sizeof(uint16_t) * pixelCount))); | 746 ((void*)pixels.get(), sizeof(uint16_t) * pixelCount))); |
| 747 decoder->setAllocator(allocator); | 747 decoder->setAllocator(allocator); |
| 748 decoder->setSampleSize(2); | 748 decoder->setSampleSize(2); |
| 749 SkBitmap bitmap; | 749 SkBitmap bitmap; |
| 750 bool success = decoder->decode(stream, &bitmap, kRGB_565_SkColorType, | 750 bool success = decoder->decode(stream, &bitmap, kRGB_565_SkColorType, |
| 751 SkImageDecoder::kDecodePixels_Mode) != SkImag
eDecoder::kFailure; | 751 SkImageDecoder::kDecodePixels_Mode) != SkImag
eDecoder::kFailure; |
| 752 REPORTER_ASSERT(r, success); | 752 REPORTER_ASSERT(r, success); |
| 753 REPORTER_ASSERT(r, !allocator->ready()); // Decoder used correct memory | 753 REPORTER_ASSERT(r, !allocator->ready()); // Decoder used correct memory |
| 754 REPORTER_ASSERT(r, sentinal == pixels[pixelCount]); | 754 REPORTER_ASSERT(r, sentinal == pixels[pixelCount]); |
| 755 } | 755 } |
| OLD | NEW |