Chromium Code Reviews| 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 "SkCodec.h" | 8 #include "SkCodec.h" |
| 9 #include "SkCodecPriv.h" | 9 #include "SkCodecPriv.h" |
| 10 #include "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 162 return y; | 162 return y; |
| 163 } | 163 } |
| 164 fSwizzler->swizzle(dstRow, fSrcBuffer.get()); | 164 fSwizzler->swizzle(dstRow, fSrcBuffer.get()); |
| 165 dstRow = SkTAddOffset<void>(dstRow, dstRowBytes); | 165 dstRow = SkTAddOffset<void>(dstRow, dstRowBytes); |
| 166 } | 166 } |
| 167 return count; | 167 return count; |
| 168 } | 168 } |
| 169 | 169 |
| 170 SkCodec::Result SkWbmpCodec::onStartScanlineDecode(const SkImageInfo& dstInfo, | 170 SkCodec::Result SkWbmpCodec::onStartScanlineDecode(const SkImageInfo& dstInfo, |
| 171 const Options& options, SkPMColor inputColorTable[], int* inputColorCoun t) { | 171 const Options& options, SkPMColor inputColorTable[], int* inputColorCoun t) { |
| 172 if (options.fSubset) { | |
|
msarett
2015/11/13 18:52:44
You could argue that this goes too far. Instead,
scroggo
2015/11/16 14:31:35
It seems like this doesn't get us any closer to su
msarett
2015/11/16 14:46:37
sgtm
| |
| 173 // Subsets are not supported. | |
| 174 return kUnimplemented; | |
| 175 } | |
| 176 | |
| 177 if (!valid_alpha(dstInfo.alphaType(), this->getInfo().alphaType())) { | 172 if (!valid_alpha(dstInfo.alphaType(), this->getInfo().alphaType())) { |
| 178 return kInvalidConversion; | 173 return kInvalidConversion; |
| 179 } | 174 } |
| 180 | 175 |
| 181 // Fill in the color table | 176 // Fill in the color table |
| 182 setup_color_table(dstInfo.colorType(), inputColorTable, inputColorCount); | 177 setup_color_table(dstInfo.colorType(), inputColorTable, inputColorCount); |
| 183 | 178 |
| 184 // Copy the color table to a pointer that can be owned by the scanline decod er | 179 // Copy the color table to a pointer that can be owned by the scanline decod er |
| 185 if (kIndex_8_SkColorType == dstInfo.colorType()) { | 180 if (kIndex_8_SkColorType == dstInfo.colorType()) { |
| 186 fColorTable.reset(new SkColorTable(inputColorTable, 2)); | 181 fColorTable.reset(new SkColorTable(inputColorTable, 2)); |
| 187 } | 182 } |
| 188 | 183 |
| 189 // Initialize the swizzler | 184 // Initialize the swizzler |
| 190 fSwizzler.reset(this->initializeSwizzler(dstInfo, get_color_ptr(fColorTable. get()), options)); | 185 fSwizzler.reset(this->initializeSwizzler(dstInfo, get_color_ptr(fColorTable. get()), options)); |
| 191 if (nullptr == fSwizzler.get()) { | 186 if (nullptr == fSwizzler.get()) { |
| 192 return kInvalidConversion; | 187 return kInvalidConversion; |
| 193 } | 188 } |
| 194 | 189 |
| 195 fSrcBuffer.reset(fSrcRowBytes); | 190 fSrcBuffer.reset(fSrcRowBytes); |
| 196 | 191 |
| 197 return kSuccess; | 192 return kSuccess; |
| 198 } | 193 } |
| OLD | NEW |