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 "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkColor.h" | 10 #include "SkColor.h" |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 // Only runs in debug mode since we are testing for a crash. | 225 // Only runs in debug mode since we are testing for a crash. |
226 static void test_stream_life() { | 226 static void test_stream_life() { |
227 const SkImageEncoder::Type gTypes[] = { | 227 const SkImageEncoder::Type gTypes[] = { |
228 #ifdef SK_BUILD_FOR_ANDROID | 228 #ifdef SK_BUILD_FOR_ANDROID |
229 SkImageEncoder::kJPEG_Type, | 229 SkImageEncoder::kJPEG_Type, |
230 SkImageEncoder::kPNG_Type, | 230 SkImageEncoder::kPNG_Type, |
231 #endif | 231 #endif |
232 SkImageEncoder::kWEBP_Type, | 232 SkImageEncoder::kWEBP_Type, |
233 }; | 233 }; |
234 for (size_t i = 0; i < SK_ARRAY_COUNT(gTypes); ++i) { | 234 for (size_t i = 0; i < SK_ARRAY_COUNT(gTypes); ++i) { |
235 SkDebugf("encoding to %i\n", i); | 235 //SkDebugf("encoding to %i\n", i); |
236 SkAutoTUnref<SkStream> stream(create_image_stream(gTypes[i])); | 236 SkAutoTUnref<SkStream> stream(create_image_stream(gTypes[i])); |
237 if (NULL == stream.get()) { | 237 if (NULL == stream.get()) { |
238 SkDebugf("no stream\n"); | 238 SkDebugf("no stream\n"); |
239 continue; | 239 continue; |
240 } | 240 } |
241 SkAutoTDelete<SkImageDecoder> decoder(SkImageDecoder::Factory(stream)); | 241 SkAutoTDelete<SkImageDecoder> decoder(SkImageDecoder::Factory(stream)); |
242 if (NULL == decoder.get()) { | 242 if (NULL == decoder.get()) { |
243 SkDebugf("no decoder\n"); | 243 SkDebugf("no decoder\n"); |
244 continue; | 244 continue; |
245 } | 245 } |
(...skipping 15 matching lines...) Expand all Loading... |
261 test_unpremul(reporter); | 261 test_unpremul(reporter); |
262 test_pref_config_table(reporter); | 262 test_pref_config_table(reporter); |
263 #ifdef SK_DEBUG | 263 #ifdef SK_DEBUG |
264 test_stream_life(); | 264 test_stream_life(); |
265 #endif | 265 #endif |
266 } | 266 } |
267 | 267 |
268 #include "TestClassDef.h" | 268 #include "TestClassDef.h" |
269 DEFINE_TESTCLASS("ImageDecoding", ImageDecodingTestClass, | 269 DEFINE_TESTCLASS("ImageDecoding", ImageDecodingTestClass, |
270 test_imageDecodingTests) | 270 test_imageDecodingTests) |
OLD | NEW |