Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(48)

Side by Side Diff: tests/ImageDecodingTest.cpp

Issue 21612003: Support decoding subsets from JPG on Android. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/images/SkJpegUtility.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 } 218 }
219 return SkNEW_ARGS(SkMemoryStream, (data.get())); 219 return SkNEW_ARGS(SkMemoryStream, (data.get()));
220 } 220 }
221 221
222 // For every format that supports tile based decoding, ensure that 222 // For every format that supports tile based decoding, ensure that
223 // calling decodeSubset will not fail if the caller has unreffed the 223 // calling decodeSubset will not fail if the caller has unreffed the
224 // stream provided in buildTileIndex. 224 // stream provided in buildTileIndex.
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_FRAMEWORK 228 #ifdef SK_BUILD_FOR_ANDROID
229 SkImageEncoder::kJPEG_Type, 229 SkImageEncoder::kJPEG_Type,
230 #endif
231 #ifdef SK_BUILD_FOR_ANDROID
232 SkImageEncoder::kPNG_Type, 230 SkImageEncoder::kPNG_Type,
233 #endif 231 #endif
234 SkImageEncoder::kWEBP_Type, 232 SkImageEncoder::kWEBP_Type,
235 }; 233 };
236 for (size_t i = 0; i < SK_ARRAY_COUNT(gTypes); ++i) { 234 for (size_t i = 0; i < SK_ARRAY_COUNT(gTypes); ++i) {
237 SkDebugf("encoding to %i\n", i); 235 SkDebugf("encoding to %i\n", i);
238 SkAutoTUnref<SkStream> stream(create_image_stream(gTypes[i])); 236 SkAutoTUnref<SkStream> stream(create_image_stream(gTypes[i]));
239 if (NULL == stream.get()) { 237 if (NULL == stream.get()) {
240 SkDebugf("no stream\n"); 238 SkDebugf("no stream\n");
241 continue; 239 continue;
(...skipping 21 matching lines...) Expand all
263 test_unpremul(reporter); 261 test_unpremul(reporter);
264 test_pref_config_table(reporter); 262 test_pref_config_table(reporter);
265 #ifdef SK_DEBUG 263 #ifdef SK_DEBUG
266 test_stream_life(); 264 test_stream_life();
267 #endif 265 #endif
268 } 266 }
269 267
270 #include "TestClassDef.h" 268 #include "TestClassDef.h"
271 DEFINE_TESTCLASS("ImageDecoding", ImageDecodingTestClass, 269 DEFINE_TESTCLASS("ImageDecoding", ImageDecodingTestClass,
272 test_imageDecodingTests) 270 test_imageDecodingTests)
OLDNEW
« no previous file with comments | « src/images/SkJpegUtility.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698