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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
159 return kInvalidParameters; | 159 return kInvalidParameters; |
160 } | 160 } |
161 } else { | 161 } else { |
162 if (ctableCount) { | 162 if (ctableCount) { |
163 *ctableCount = 0; | 163 *ctableCount = 0; |
164 } | 164 } |
165 ctableCount = nullptr; | 165 ctableCount = nullptr; |
166 ctable = nullptr; | 166 ctable = nullptr; |
167 } | 167 } |
168 | 168 |
169 { | |
170 SkAlphaType canonical; | |
171 if (!SkColorTypeValidateAlphaType(info.colorType(), info.alphaType(), &c anonical) | |
scroggo
2016/02/12 17:13:55
What is this redundant with? I started to remove t
msarett
2016/02/12 17:41:31
This just checks that the alphaType matches the co
scroggo
2016/02/12 17:59:00
Ah, got it. So you're just moving this into a comm
| |
172 || canonical != info.alphaType()) | |
173 { | |
174 return kInvalidConversion; | |
175 } | |
176 } | |
177 | |
178 if (!this->rewindIfNeeded()) { | 169 if (!this->rewindIfNeeded()) { |
179 return kCouldNotRewind; | 170 return kCouldNotRewind; |
180 } | 171 } |
181 | 172 |
182 // Default options. | 173 // Default options. |
183 Options optsStorage; | 174 Options optsStorage; |
184 if (nullptr == options) { | 175 if (nullptr == options) { |
185 options = &optsStorage; | 176 options = &optsStorage; |
186 } else if (options->fSubset) { | 177 } else if (options->fSubset) { |
187 SkIRect subset(*options->fSubset); | 178 SkIRect subset(*options->fSubset); |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
374 SkASSERT(1 == linesRequested || this->getInfo().height() == linesReq uested); | 365 SkASSERT(1 == linesRequested || this->getInfo().height() == linesReq uested); |
375 const SkImageInfo fillInfo = info.makeWH(info.width(), 1); | 366 const SkImageInfo fillInfo = info.makeWH(info.width(), 1); |
376 for (int srcY = linesDecoded; srcY < linesRequested; srcY++) { | 367 for (int srcY = linesDecoded; srcY < linesRequested; srcY++) { |
377 fillDst = SkTAddOffset<void>(dst, this->outputScanline(srcY) * r owBytes); | 368 fillDst = SkTAddOffset<void>(dst, this->outputScanline(srcY) * r owBytes); |
378 fill_proc(fillInfo, fillDst, rowBytes, fillValue, zeroInit, samp ler); | 369 fill_proc(fillInfo, fillDst, rowBytes, fillValue, zeroInit, samp ler); |
379 } | 370 } |
380 break; | 371 break; |
381 } | 372 } |
382 } | 373 } |
383 } | 374 } |
OLD | NEW |