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 "Test.h" | |
9 #include "SkBitmap.h" | 8 #include "SkBitmap.h" |
10 #include "SkData.h" | 9 #include "SkData.h" |
11 #include "SkForceLinking.h" | 10 #include "SkForceLinking.h" |
| 11 #include "SkImage.h" |
12 #include "SkImageDecoder.h" | 12 #include "SkImageDecoder.h" |
13 #include "SkImage.h" | |
14 #include "SkStream.h" | 13 #include "SkStream.h" |
| 14 #include "Test.h" |
15 | 15 |
16 __SK_FORCE_IMAGE_DECODER_LINKING; | 16 __SK_FORCE_IMAGE_DECODER_LINKING; |
17 | 17 |
18 #define JPEG_TEST_WRITE_TO_FILE_FOR_DEBUGGING 0 // do not do this for | 18 #define JPEG_TEST_WRITE_TO_FILE_FOR_DEBUGGING 0 // do not do this for |
19 // normal unit testing. | 19 // normal unit testing. |
20 static unsigned char goodJpegImage[] = { | 20 static unsigned char goodJpegImage[] = { |
21 0xFF, 0xD8, 0xFF, 0xE0, 0x00, 0x10, 0x4A, 0x46, | 21 0xFF, 0xD8, 0xFF, 0xE0, 0x00, 0x10, 0x4A, 0x46, |
22 0x49, 0x46, 0x00, 0x01, 0x01, 0x01, 0x00, 0x8F, | 22 0x49, 0x46, 0x00, 0x01, 0x01, 0x01, 0x00, 0x8F, |
23 0x00, 0x8F, 0x00, 0x00, 0xFF, 0xDB, 0x00, 0x43, | 23 0x00, 0x8F, 0x00, 0x00, 0xFF, 0xDB, 0x00, 0x43, |
24 0x00, 0x05, 0x03, 0x04, 0x04, 0x04, 0x03, 0x05, | 24 0x00, 0x05, 0x03, 0x04, 0x04, 0x04, 0x03, 0x05, |
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 // This is the fill color | 440 // This is the fill color |
441 REPORTER_ASSERT(reporter, bm8888.getColor(127, 127) == SK_ColorWHITE); | 441 REPORTER_ASSERT(reporter, bm8888.getColor(127, 127) == SK_ColorWHITE); |
442 | 442 |
443 #if JPEG_TEST_WRITE_TO_FILE_FOR_DEBUGGING | 443 #if JPEG_TEST_WRITE_TO_FILE_FOR_DEBUGGING |
444 // Check to see that the resulting bitmap is nice | 444 // Check to see that the resulting bitmap is nice |
445 bool writeSuccess = (!(bm8888.empty())) && SkImageEncoder::EncodeFile( | 445 bool writeSuccess = (!(bm8888.empty())) && SkImageEncoder::EncodeFile( |
446 "HalfOfAJpeg.png", bm8888, SkImageEncoder::kPNG_Type, 100); | 446 "HalfOfAJpeg.png", bm8888, SkImageEncoder::kPNG_Type, 100); |
447 SkASSERT(writeSuccess); | 447 SkASSERT(writeSuccess); |
448 #endif | 448 #endif |
449 } | 449 } |
OLD | NEW |