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

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

Issue 1809733002: detach -> release (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: (C) Created 4 years, 9 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/SkPngCodec.cpp ('k') | src/codec/SkWebpCodec.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 * 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 "SkCodec.h" 8 #include "SkCodec.h"
9 #include "SkCodecPriv.h" 9 #include "SkCodecPriv.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 } 161 }
162 162
163 SkCodec* SkWbmpCodec::NewFromStream(SkStream* stream) { 163 SkCodec* SkWbmpCodec::NewFromStream(SkStream* stream) {
164 SkAutoTDelete<SkStream> streamDeleter(stream); 164 SkAutoTDelete<SkStream> streamDeleter(stream);
165 SkISize size; 165 SkISize size;
166 if (!read_header(stream, &size)) { 166 if (!read_header(stream, &size)) {
167 return nullptr; 167 return nullptr;
168 } 168 }
169 SkImageInfo info = SkImageInfo::Make(size.width(), size.height(), 169 SkImageInfo info = SkImageInfo::Make(size.width(), size.height(),
170 kGray_8_SkColorType, kOpaque_SkAlphaType); 170 kGray_8_SkColorType, kOpaque_SkAlphaType);
171 return new SkWbmpCodec(info, streamDeleter.detach()); 171 return new SkWbmpCodec(info, streamDeleter.release());
172 } 172 }
173 173
174 int SkWbmpCodec::onGetScanlines(void* dst, int count, size_t dstRowBytes) { 174 int SkWbmpCodec::onGetScanlines(void* dst, int count, size_t dstRowBytes) {
175 void* dstRow = dst; 175 void* dstRow = dst;
176 for (int y = 0; y < count; ++y) { 176 for (int y = 0; y < count; ++y) {
177 if (!this->readRow(fSrcBuffer.get())) { 177 if (!this->readRow(fSrcBuffer.get())) {
178 return y; 178 return y;
179 } 179 }
180 fSwizzler->swizzle(dstRow, fSrcBuffer.get()); 180 fSwizzler->swizzle(dstRow, fSrcBuffer.get());
181 dstRow = SkTAddOffset<void>(dstRow, dstRowBytes); 181 dstRow = SkTAddOffset<void>(dstRow, dstRowBytes);
(...skipping 27 matching lines...) Expand all
209 } 209 }
210 210
211 // Initialize the swizzler 211 // Initialize the swizzler
212 fSwizzler.reset(this->initializeSwizzler(dstInfo, get_color_ptr(fColorTable. get()), options)); 212 fSwizzler.reset(this->initializeSwizzler(dstInfo, get_color_ptr(fColorTable. get()), options));
213 SkASSERT(fSwizzler); 213 SkASSERT(fSwizzler);
214 214
215 fSrcBuffer.reset(fSrcRowBytes); 215 fSrcBuffer.reset(fSrcRowBytes);
216 216
217 return kSuccess; 217 return kSuccess;
218 } 218 }
OLDNEW
« no previous file with comments | « src/codec/SkPngCodec.cpp ('k') | src/codec/SkWebpCodec.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698