OLD | NEW |
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 "SkBmpCodec.h" | 8 #include "SkBmpCodec.h" |
9 #include "SkCodec.h" | 9 #include "SkCodec.h" |
10 #include "SkCodecPriv.h" | 10 #include "SkCodecPriv.h" |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 return kInvalidParameters; | 155 return kInvalidParameters; |
156 } | 156 } |
157 } else { | 157 } else { |
158 if (ctableCount) { | 158 if (ctableCount) { |
159 *ctableCount = 0; | 159 *ctableCount = 0; |
160 } | 160 } |
161 ctableCount = nullptr; | 161 ctableCount = nullptr; |
162 ctable = nullptr; | 162 ctable = nullptr; |
163 } | 163 } |
164 | 164 |
165 { | |
166 SkAlphaType canonical; | |
167 if (!SkColorTypeValidateAlphaType(info.colorType(), info.alphaType(), &c
anonical) | |
168 || canonical != info.alphaType()) | |
169 { | |
170 return kInvalidConversion; | |
171 } | |
172 } | |
173 | |
174 if (!this->rewindIfNeeded()) { | 165 if (!this->rewindIfNeeded()) { |
175 return kCouldNotRewind; | 166 return kCouldNotRewind; |
176 } | 167 } |
177 | 168 |
178 // Default options. | 169 // Default options. |
179 Options optsStorage; | 170 Options optsStorage; |
180 if (nullptr == options) { | 171 if (nullptr == options) { |
181 options = &optsStorage; | 172 options = &optsStorage; |
182 } else if (options->fSubset) { | 173 } else if (options->fSubset) { |
183 SkIRect subset(*options->fSubset); | 174 SkIRect subset(*options->fSubset); |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 SkASSERT(1 == linesRequested || this->getInfo().height() == linesReq
uested); | 361 SkASSERT(1 == linesRequested || this->getInfo().height() == linesReq
uested); |
371 const SkImageInfo fillInfo = info.makeWH(info.width(), 1); | 362 const SkImageInfo fillInfo = info.makeWH(info.width(), 1); |
372 for (int srcY = linesDecoded; srcY < linesRequested; srcY++) { | 363 for (int srcY = linesDecoded; srcY < linesRequested; srcY++) { |
373 fillDst = SkTAddOffset<void>(dst, this->outputScanline(srcY) * r
owBytes); | 364 fillDst = SkTAddOffset<void>(dst, this->outputScanline(srcY) * r
owBytes); |
374 fill_proc(fillInfo, fillDst, rowBytes, fillValue, zeroInit, samp
ler); | 365 fill_proc(fillInfo, fillDst, rowBytes, fillValue, zeroInit, samp
ler); |
375 } | 366 } |
376 break; | 367 break; |
377 } | 368 } |
378 } | 369 } |
379 } | 370 } |
OLD | NEW |