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 "SkBitmap.h" | 8 #include "SkBitmap.h" |
9 #include "SkDecodingImageGenerator.h" | 9 #include "SkDecodingImageGenerator.h" |
10 #include "SkForceLinking.h" | |
11 #include "SkImageDecoder.h" | 10 #include "SkImageDecoder.h" |
12 #include "SkPixelRef.h" | 11 #include "SkPixelRef.h" |
13 #include "SkStream.h" | 12 #include "SkStream.h" |
14 #include "SkTemplates.h" | 13 #include "SkTemplates.h" |
15 #include "Test.h" | 14 #include "Test.h" |
16 | 15 |
17 __SK_FORCE_IMAGE_DECODER_LINKING; | |
18 | |
19 #define JPEG_TEST_WRITE_TO_FILE_FOR_DEBUGGING 0 // do not do this for | 16 #define JPEG_TEST_WRITE_TO_FILE_FOR_DEBUGGING 0 // do not do this for |
20 // normal unit testing. | 17 // normal unit testing. |
21 static unsigned char goodJpegImage[] = { | 18 static unsigned char goodJpegImage[] = { |
22 0xFF, 0xD8, 0xFF, 0xE0, 0x00, 0x10, 0x4A, 0x46, | 19 0xFF, 0xD8, 0xFF, 0xE0, 0x00, 0x10, 0x4A, 0x46, |
23 0x49, 0x46, 0x00, 0x01, 0x01, 0x01, 0x00, 0x8F, | 20 0x49, 0x46, 0x00, 0x01, 0x01, 0x01, 0x00, 0x8F, |
24 0x00, 0x8F, 0x00, 0x00, 0xFF, 0xDB, 0x00, 0x43, | 21 0x00, 0x8F, 0x00, 0x00, 0xFF, 0xDB, 0x00, 0x43, |
25 0x00, 0x05, 0x03, 0x04, 0x04, 0x04, 0x03, 0x05, | 22 0x00, 0x05, 0x03, 0x04, 0x04, 0x04, 0x03, 0x05, |
26 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x06, 0x07, | 23 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x06, 0x07, |
27 0x0C, 0x08, 0x07, 0x07, 0x07, 0x07, 0x0F, 0x0B, | 24 0x0C, 0x08, 0x07, 0x07, 0x07, 0x07, 0x0F, 0x0B, |
28 0x0B, 0x09, 0x0C, 0x11, 0x0F, 0x12, 0x12, 0x11, | 25 0x0B, 0x09, 0x0C, 0x11, 0x0F, 0x12, 0x12, 0x11, |
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 } | 487 } |
491 SkAutoMalloc storage(totalSize); | 488 SkAutoMalloc storage(totalSize); |
492 void* planes[3]; | 489 void* planes[3]; |
493 planes[0] = storage.get(); | 490 planes[0] = storage.get(); |
494 planes[1] = (uint8_t*)planes[0] + sizes[0]; | 491 planes[1] = (uint8_t*)planes[0] + sizes[0]; |
495 planes[2] = (uint8_t*)planes[1] + sizes[1]; | 492 planes[2] = (uint8_t*)planes[1] + sizes[1]; |
496 | 493 |
497 // Get the YUV planes | 494 // Get the YUV planes |
498 REPORTER_ASSERT(reporter, pixelRef->getYUV8Planes(yuvSizes, planes, rowBytes
, NULL)); | 495 REPORTER_ASSERT(reporter, pixelRef->getYUV8Planes(yuvSizes, planes, rowBytes
, NULL)); |
499 } | 496 } |
OLD | NEW |