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

Side by Side Diff: src/images/SkImageDecoder_libbmp.cpp

Issue 1779263003: Make sp variants for SkData (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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/images/SkImageDecoder_ktx.cpp ('k') | src/images/SkImageDecoder_libico.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 2007 The Android Open Source Project 3 * Copyright 2007 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 "bmpdecoderhelper.h" 10 #include "bmpdecoderhelper.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 SkTDArray<uint8_t> fRGB; 90 SkTDArray<uint8_t> fRGB;
91 int fWidth; 91 int fWidth;
92 int fHeight; 92 int fHeight;
93 bool fJustBounds; 93 bool fJustBounds;
94 }; 94 };
95 95
96 SkImageDecoder::Result SkBMPImageDecoder::onDecode(SkStream* stream, SkBitmap* b m, Mode mode) { 96 SkImageDecoder::Result SkBMPImageDecoder::onDecode(SkStream* stream, SkBitmap* b m, Mode mode) {
97 // First read the entire stream, so that all of the data can be passed to 97 // First read the entire stream, so that all of the data can be passed to
98 // the BmpDecoderHelper. 98 // the BmpDecoderHelper.
99 99
100 SkAutoTUnref<SkData> data(SkCopyStreamToData(stream)); 100 auto data = SkCopyStreamToData(stream);
101 if (!data) { 101 if (!data) {
102 return kFailure; 102 return kFailure;
103 } 103 }
104 104
105 // Byte length of all of the data. 105 // Byte length of all of the data.
106 const size_t length = data->size(); 106 const size_t length = data->size();
107 if (0 == length) { 107 if (0 == length) {
108 return kFailure; 108 return kFailure;
109 } 109 }
110 110
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 const int dstHeight = sampler.scaledHeight(); 157 const int dstHeight = sampler.scaledHeight();
158 const uint8_t* srcRow = callback.rgb(); 158 const uint8_t* srcRow = callback.rgb();
159 159
160 srcRow += sampler.srcY0() * srcRowBytes; 160 srcRow += sampler.srcY0() * srcRowBytes;
161 for (int y = 0; y < dstHeight; y++) { 161 for (int y = 0; y < dstHeight; y++) {
162 sampler.next(srcRow); 162 sampler.next(srcRow);
163 srcRow += sampler.srcDY() * srcRowBytes; 163 srcRow += sampler.srcDY() * srcRowBytes;
164 } 164 }
165 return kSuccess; 165 return kSuccess;
166 } 166 }
OLDNEW
« no previous file with comments | « src/images/SkImageDecoder_ktx.cpp ('k') | src/images/SkImageDecoder_libico.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698