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

Side by Side Diff: src/pdf/SkDeflate.cpp

Issue 1316123003: Style Change: SkNEW->new; SkDELETE->delete (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-26 (Wednesday) 15:59:00 EDT 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/pathops/SkPathOpsTSect.h ('k') | src/pdf/SkPDFBitmap.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 #include "SkData.h" 10 #include "SkData.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 } 58 }
59 59
60 // Hide all zlib impl details. 60 // Hide all zlib impl details.
61 struct SkDeflateWStream::Impl { 61 struct SkDeflateWStream::Impl {
62 SkWStream* fOut; 62 SkWStream* fOut;
63 unsigned char fInBuffer[SKDEFLATEWSTREAM_INPUT_BUFFER_SIZE]; 63 unsigned char fInBuffer[SKDEFLATEWSTREAM_INPUT_BUFFER_SIZE];
64 size_t fInBufferIndex; 64 size_t fInBufferIndex;
65 z_stream fZStream; 65 z_stream fZStream;
66 }; 66 };
67 67
68 SkDeflateWStream::SkDeflateWStream(SkWStream* out) 68 SkDeflateWStream::SkDeflateWStream(SkWStream* out) : fImpl(new SkDeflateWStream: :Impl) {
69 : fImpl(SkNEW(SkDeflateWStream::Impl)) {
70 fImpl->fOut = out; 69 fImpl->fOut = out;
71 fImpl->fInBufferIndex = 0; 70 fImpl->fInBufferIndex = 0;
72 if (!fImpl->fOut) { 71 if (!fImpl->fOut) {
73 return; 72 return;
74 } 73 }
75 fImpl->fZStream.zalloc = &skia_alloc_func; 74 fImpl->fZStream.zalloc = &skia_alloc_func;
76 fImpl->fZStream.zfree = &skia_free_func; 75 fImpl->fZStream.zfree = &skia_free_func;
77 fImpl->fZStream.opaque = NULL; 76 fImpl->fZStream.opaque = NULL;
78 SkDEBUGCODE(int r =) deflateInit(&fImpl->fZStream, Z_DEFAULT_COMPRESSION); 77 SkDEBUGCODE(int r =) deflateInit(&fImpl->fZStream, Z_DEFAULT_COMPRESSION);
79 SkASSERT(Z_OK == r); 78 SkASSERT(Z_OK == r);
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 fImpl->fInBuffer, fImpl->fInBufferIndex); 110 fImpl->fInBuffer, fImpl->fInBufferIndex);
112 fImpl->fInBufferIndex = 0; 111 fImpl->fInBufferIndex = 0;
113 } 112 }
114 } 113 }
115 return true; 114 return true;
116 } 115 }
117 116
118 size_t SkDeflateWStream::bytesWritten() const { 117 size_t SkDeflateWStream::bytesWritten() const {
119 return fImpl->fZStream.total_in + fImpl->fInBufferIndex; 118 return fImpl->fZStream.total_in + fImpl->fInBufferIndex;
120 } 119 }
OLDNEW
« no previous file with comments | « src/pathops/SkPathOpsTSect.h ('k') | src/pdf/SkPDFBitmap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698