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

Side by Side Diff: src/images/SkJpegUtility.h

Issue 849103004: Make SkStream *not* ref counted. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase, just in case. Created 5 years, 11 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/images/SkImageDecoder_libwebp.cpp ('k') | src/images/SkJpegUtility.cpp » ('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 /* 2 /*
3 * Copyright 2010 The Android Open Source Project 3 * Copyright 2010 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #ifndef SkJpegUtility_DEFINED 10 #ifndef SkJpegUtility_DEFINED
(...skipping 17 matching lines...) Expand all
28 }; 28 };
29 29
30 30
31 void skjpeg_error_exit(j_common_ptr cinfo); 31 void skjpeg_error_exit(j_common_ptr cinfo);
32 32
33 /////////////////////////////////////////////////////////////////////////// 33 ///////////////////////////////////////////////////////////////////////////
34 /* Our source struct for directing jpeg to our stream object. 34 /* Our source struct for directing jpeg to our stream object.
35 */ 35 */
36 struct skjpeg_source_mgr : jpeg_source_mgr { 36 struct skjpeg_source_mgr : jpeg_source_mgr {
37 skjpeg_source_mgr(SkStream* stream, SkImageDecoder* decoder); 37 skjpeg_source_mgr(SkStream* stream, SkImageDecoder* decoder);
38 ~skjpeg_source_mgr();
39 38
40 // fStream is ref'ed and unref'ed 39 // Unowned.
41 SkStream* fStream; 40 SkStream* fStream;
42 // Unowned pointer to the decoder, used to check if the decoding process 41 // Unowned pointer to the decoder, used to check if the decoding process
43 // has been cancelled. 42 // has been cancelled.
44 SkImageDecoder* fDecoder; 43 SkImageDecoder* fDecoder;
45 enum { 44 enum {
46 kBufferSize = 1024 45 kBufferSize = 1024
47 }; 46 };
48 char fBuffer[kBufferSize]; 47 char fBuffer[kBufferSize];
49 }; 48 };
50 49
51 ///////////////////////////////////////////////////////////////////////////// 50 /////////////////////////////////////////////////////////////////////////////
52 /* Our destination struct for directing decompressed pixels to our stream 51 /* Our destination struct for directing decompressed pixels to our stream
53 * object. 52 * object.
54 */ 53 */
55 struct skjpeg_destination_mgr : jpeg_destination_mgr { 54 struct skjpeg_destination_mgr : jpeg_destination_mgr {
56 skjpeg_destination_mgr(SkWStream* stream); 55 skjpeg_destination_mgr(SkWStream* stream);
57 56
58 SkWStream* fStream; 57 SkWStream* fStream;
59 58
60 enum { 59 enum {
61 kBufferSize = 1024 60 kBufferSize = 1024
62 }; 61 };
63 uint8_t fBuffer[kBufferSize]; 62 uint8_t fBuffer[kBufferSize];
64 }; 63 };
65 64
66 #endif 65 #endif
OLDNEW
« no previous file with comments | « src/images/SkImageDecoder_libwebp.cpp ('k') | src/images/SkJpegUtility.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698