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

Side by Side Diff: src/codec/SkJpegUtility_codec.cpp

Issue 1322623004: Call standard libjpeg/libjpeg-turbo APIs from SkJpegCodec (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Need to save the state, so we can call onGetScaledDimensions before rewinding Created 5 years, 3 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
« no previous file with comments | « src/codec/SkJpegUtility_codec.h ('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 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
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 }
OLDNEW
« no previous file with comments | « src/codec/SkJpegUtility_codec.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698