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 "SkCodecPriv.h" | 8 #include "SkCodecPriv.h" |
9 #include "SkJpegUtility_codec.h" | 9 #include "SkJpegUtility_codec.h" |
10 | 10 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 /* | 66 /* |
67 * Constructor for the source manager that we provide to libjpeg | 67 * Constructor for the source manager that we provide to libjpeg |
68 * We provide skia implementations of all of the stream processing functions req
uired by libjpeg | 68 * We provide skia implementations of all of the stream processing functions req
uired by libjpeg |
69 */ | 69 */ |
70 skjpeg_source_mgr::skjpeg_source_mgr(SkStream* stream) | 70 skjpeg_source_mgr::skjpeg_source_mgr(SkStream* stream) |
71 : fStream(stream) | 71 : fStream(stream) |
72 { | 72 { |
73 init_source = sk_init_source; | 73 init_source = sk_init_source; |
74 fill_input_buffer = sk_fill_input_buffer; | 74 fill_input_buffer = sk_fill_input_buffer; |
75 skip_input_data = sk_skip_input_data; | 75 skip_input_data = sk_skip_input_data; |
76 resync_to_restart = chromium_jpeg_resync_to_restart; | 76 resync_to_restart = jpeg_resync_to_restart; |
77 term_source = sk_term_source; | 77 term_source = sk_term_source; |
78 } | 78 } |
79 | 79 |
80 /* | 80 /* |
81 * Call longjmp to continue execution on an error | 81 * Call longjmp to continue execution on an error |
82 */ | 82 */ |
83 void skjpeg_err_exit(j_common_ptr dinfo) { | 83 void skjpeg_err_exit(j_common_ptr dinfo) { |
84 // Simply return to Skia client code | 84 // Simply return to Skia client code |
85 // JpegDecoderMgr will take care of freeing memory | 85 // JpegDecoderMgr will take care of freeing memory |
86 skjpeg_error_mgr* error = (skjpeg_error_mgr*) dinfo->err; | 86 skjpeg_error_mgr* error = (skjpeg_error_mgr*) dinfo->err; |
87 (*error->output_message) (dinfo); | 87 (*error->output_message) (dinfo); |
88 longjmp(error->fJmpBuf, 1); | 88 longjmp(error->fJmpBuf, 1); |
89 } | 89 } |
OLD | NEW |