Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 /* | |
| 2 * Copyright 2015 Google Inc. | |
| 3 * | |
| 4 * Use of this source code is governed by a BSD-style license that can be | |
| 5 * found in the LICENSE file. | |
| 6 */ | |
| 7 | |
| 8 #ifndef SkJpegAutoClean_DEFINED | |
| 9 #define SkJpegAutoClean_DEFINED | |
| 10 | |
| 11 #include "SkJpegUtility.h" | |
| 12 #include "SkTemplates.h" | |
| 13 | |
| 14 // stdio is needed for jpeglib | |
| 15 #include <stdio.h> | |
| 16 #include "jpeglib.h" | |
| 17 | |
| 18 /* | |
| 19 * This object automatically cleans up memory after a jpeg decode | |
| 20 */ | |
| 21 class JpegAutoClean : SkNoncopyable { | |
| 22 public: | |
| 23 | |
| 24 /* | |
| 25 * Takes ownership of all thre input pointers. | |
|
scroggo
2015/04/14 13:10:32
three*
msarett
2015/04/14 19:30:36
Acknowledged.
| |
| 26 */ | |
| 27 JpegAutoClean(jpeg_decompress_struct* dinfo, | |
| 28 skjpeg_source_mgr* srcMgr, | |
| 29 skjpeg_error_mgr* errMgr); | |
| 30 | |
| 31 /* | |
| 32 * Calls destroy on jpeg_decompress_struct. | |
| 33 * Owned pointers will be delted automatically. | |
|
scroggo
2015/04/14 13:10:32
deleted*
msarett
2015/04/14 19:30:36
Acknowledged.
| |
| 34 */ | |
| 35 ~JpegAutoClean(); | |
| 36 | |
| 37 /* | |
| 38 * Get the decompress info struct. | |
| 39 */ | |
| 40 jpeg_decompress_struct* dinfo(); | |
| 41 | |
| 42 private: | |
| 43 | |
| 44 SkAutoTDelete<jpeg_decompress_struct> fDInfo; | |
|
scroggo
2015/04/14 13:10:32
Do these all need to be passed in? What if you mak
msarett
2015/04/14 19:30:36
Done.
| |
| 45 SkAutoTDelete<skjpeg_source_mgr> fSrcMgr; | |
| 46 SkAutoTDelete<skjpeg_error_mgr> fErrorMgr; | |
| 47 }; | |
| 48 | |
| 49 #endif | |
| OLD | NEW |