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 "SkBmpStandardCodec.h" | 8 #include "SkBmpStandardCodec.h" |
9 #include "SkCodecPriv.h" | 9 #include "SkCodecPriv.h" |
10 #include "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 default: | 230 default: |
231 SkASSERT(false); | 231 SkASSERT(false); |
232 return false; | 232 return false; |
233 } | 233 } |
234 | 234 |
235 // Get a pointer to the color table if it exists | 235 // Get a pointer to the color table if it exists |
236 const SkPMColor* colorPtr = get_color_ptr(fColorTable.get()); | 236 const SkPMColor* colorPtr = get_color_ptr(fColorTable.get()); |
237 | 237 |
238 // Create swizzler | 238 // Create swizzler |
239 fSwizzler.reset(SkSwizzler::CreateSwizzler(config, | 239 fSwizzler.reset(SkSwizzler::CreateSwizzler(config, |
240 colorPtr, dstInfo, opts.fZeroInitialized, this->getInfo())); | 240 colorPtr, dstInfo, opts.fZeroInitialized)); |
241 | 241 |
242 if (NULL == fSwizzler.get()) { | 242 if (NULL == fSwizzler.get()) { |
243 return false; | 243 return false; |
244 } | 244 } |
245 return true; | 245 return true; |
246 } | 246 } |
247 | 247 |
248 /* | 248 /* |
249 * Choose a fill for failures due to an incomplete image. We will use zero as | 249 * Choose a fill for failures due to an incomplete image. We will use zero as |
250 * the default palette index, black for opaque images, and transparent for | 250 * the default palette index, black for opaque images, and transparent for |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 uint32_t alphaBit = | 352 uint32_t alphaBit = |
353 (fSrcBuffer.get()[quotient] >> shift) & 0x1; | 353 (fSrcBuffer.get()[quotient] >> shift) & 0x1; |
354 dstRow[x] &= alphaBit - 1; | 354 dstRow[x] &= alphaBit - 1; |
355 } | 355 } |
356 } | 356 } |
357 } | 357 } |
358 | 358 |
359 // Finished decoding the entire image | 359 // Finished decoding the entire image |
360 return kSuccess; | 360 return kSuccess; |
361 } | 361 } |
OLD | NEW |