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

Side by Side Diff: src/codec/SkJpegDecoderMgr.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/SkJpegDecoderMgr.h ('k') | src/codec/SkJpegUtility_codec.h » ('j') | 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 "SkJpegDecoderMgr.h" 8 #include "SkJpegDecoderMgr.h"
9 #include "SkJpegUtility_codec.h" 9 #include "SkJpegUtility_codec.h"
10 10
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 default: 44 default:
45 return kN32_SkColorType; 45 return kN32_SkColorType;
46 } 46 }
47 } 47 }
48 48
49 JpegDecoderMgr::JpegDecoderMgr(SkStream* stream) 49 JpegDecoderMgr::JpegDecoderMgr(SkStream* stream)
50 : fSrcMgr(stream) 50 : fSrcMgr(stream)
51 , fInit(false) 51 , fInit(false)
52 { 52 {
53 // Error manager must be set before any calls to libjeg in order to handle f ailures 53 // Error manager must be set before any calls to libjeg in order to handle f ailures
54 fDInfo.err = chromium_jpeg_std_error(&fErrorMgr); 54 fDInfo.err = jpeg_std_error(&fErrorMgr);
55 fErrorMgr.error_exit = skjpeg_err_exit; 55 fErrorMgr.error_exit = skjpeg_err_exit;
56 } 56 }
57 57
58 void JpegDecoderMgr::init() { 58 void JpegDecoderMgr::init() {
59 jpeg_create_decompress(&fDInfo); 59 jpeg_create_decompress(&fDInfo);
60 fInit = true; 60 fInit = true;
61 fDInfo.src = &fSrcMgr; 61 fDInfo.src = &fSrcMgr;
62 fDInfo.err->emit_message = &emit_message; 62 fDInfo.err->emit_message = &emit_message;
63 fDInfo.err->output_message = &output_message; 63 fDInfo.err->output_message = &output_message;
64 } 64 }
65 65
66 JpegDecoderMgr::~JpegDecoderMgr() { 66 JpegDecoderMgr::~JpegDecoderMgr() {
67 if (fInit) { 67 if (fInit) {
68 jpeg_destroy_decompress(&fDInfo); 68 jpeg_destroy_decompress(&fDInfo);
69 } 69 }
70 } 70 }
71 71
72 jmp_buf& JpegDecoderMgr::getJmpBuf() { 72 jmp_buf& JpegDecoderMgr::getJmpBuf() {
73 return fErrorMgr.fJmpBuf; 73 return fErrorMgr.fJmpBuf;
74 } 74 }
75 75
76 jpeg_decompress_struct* JpegDecoderMgr::dinfo() { 76 jpeg_decompress_struct* JpegDecoderMgr::dinfo() {
77 return &fDInfo; 77 return &fDInfo;
78 } 78 }
OLDNEW
« no previous file with comments | « src/codec/SkJpegDecoderMgr.h ('k') | src/codec/SkJpegUtility_codec.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698