OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "SkJpegUtility.h" |
| 9 |
8 #include "SkCodecPriv.h" | 10 #include "SkCodecPriv.h" |
9 #include "SkJpegUtility_codec.h" | |
10 | 11 |
11 /* | 12 /* |
12 * Initialize the source manager | 13 * Initialize the source manager |
13 */ | 14 */ |
14 static void sk_init_source(j_decompress_ptr dinfo) { | 15 static void sk_init_source(j_decompress_ptr dinfo) { |
15 skjpeg_source_mgr* src = (skjpeg_source_mgr*) dinfo->src; | 16 skjpeg_source_mgr* src = (skjpeg_source_mgr*) dinfo->src; |
16 src->next_input_byte = (const JOCTET*) src->fBuffer; | 17 src->next_input_byte = (const JOCTET*) src->fBuffer; |
17 src->bytes_in_buffer = 0; | 18 src->bytes_in_buffer = 0; |
18 } | 19 } |
19 | 20 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 /* | 86 /* |
86 * Call longjmp to continue execution on an error | 87 * Call longjmp to continue execution on an error |
87 */ | 88 */ |
88 void skjpeg_err_exit(j_common_ptr dinfo) { | 89 void skjpeg_err_exit(j_common_ptr dinfo) { |
89 // Simply return to Skia client code | 90 // Simply return to Skia client code |
90 // JpegDecoderMgr will take care of freeing memory | 91 // JpegDecoderMgr will take care of freeing memory |
91 skjpeg_error_mgr* error = (skjpeg_error_mgr*) dinfo->err; | 92 skjpeg_error_mgr* error = (skjpeg_error_mgr*) dinfo->err; |
92 (*error->output_message) (dinfo); | 93 (*error->output_message) (dinfo); |
93 longjmp(error->fJmpBuf, 1); | 94 longjmp(error->fJmpBuf, 1); |
94 } | 95 } |
OLD | NEW |