| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2010 The Android Open Source Project | 2 * Copyright 2010 The Android Open Source Project |
| 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 | 8 |
| 9 #include "SkJpegUtility.h" | 9 #include "SkJpegUtility_images.h" |
| 10 | 10 |
| 11 ///////////////////////////////////////////////////////////////////// | 11 ///////////////////////////////////////////////////////////////////// |
| 12 static void sk_init_source(j_decompress_ptr cinfo) { | 12 static void sk_init_source(j_decompress_ptr cinfo) { |
| 13 skjpeg_source_mgr* src = (skjpeg_source_mgr*)cinfo->src; | 13 skjpeg_source_mgr* src = (skjpeg_source_mgr*)cinfo->src; |
| 14 src->next_input_byte = (const JOCTET*)src->fBuffer; | 14 src->next_input_byte = (const JOCTET*)src->fBuffer; |
| 15 src->bytes_in_buffer = 0; | 15 src->bytes_in_buffer = 0; |
| 16 #ifdef SK_BUILD_FOR_ANDROID | 16 #ifdef SK_BUILD_FOR_ANDROID |
| 17 src->current_offset = 0; | 17 src->current_offset = 0; |
| 18 #endif | 18 #endif |
| 19 if (!src->fStream->rewind()) { | 19 if (!src->fStream->rewind()) { |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 void skjpeg_error_exit(j_common_ptr cinfo) { | 157 void skjpeg_error_exit(j_common_ptr cinfo) { |
| 158 skjpeg_error_mgr* error = (skjpeg_error_mgr*)cinfo->err; | 158 skjpeg_error_mgr* error = (skjpeg_error_mgr*)cinfo->err; |
| 159 | 159 |
| 160 (*error->output_message) (cinfo); | 160 (*error->output_message) (cinfo); |
| 161 | 161 |
| 162 /* Let the memory manager delete any temp files before we die */ | 162 /* Let the memory manager delete any temp files before we die */ |
| 163 jpeg_destroy(cinfo); | 163 jpeg_destroy(cinfo); |
| 164 | 164 |
| 165 longjmp(error->fJmpBuf, -1); | 165 longjmp(error->fJmpBuf, -1); |
| 166 } | 166 } |
| OLD | NEW |