| 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" |
| 11 #include "SkColorTable.h" | 11 #include "SkColorTable.h" |
| 12 #include "SkData.h" | 12 #include "SkData.h" |
| 13 #include "SkStream.h" | 13 #include "SkStream.h" |
| 14 #include "SkCodec_wbmp.h" | 14 #include "SkWbmpCodec.h" |
| 15 | 15 |
| 16 // Each bit represents a pixel, so width is actually a number of bits. | 16 // Each bit represents a pixel, so width is actually a number of bits. |
| 17 // A row will always be stored in bytes, so we round width up to the | 17 // A row will always be stored in bytes, so we round width up to the |
| 18 // nearest multiple of 8 to get the number of bits actually in the row. | 18 // nearest multiple of 8 to get the number of bits actually in the row. |
| 19 // We then divide by 8 to convert to bytes. | 19 // We then divide by 8 to convert to bytes. |
| 20 static inline size_t get_src_row_bytes(int width) { | 20 static inline size_t get_src_row_bytes(int width) { |
| 21 return SkAlign8(width) >> 3; | 21 return SkAlign8(width) >> 3; |
| 22 } | 22 } |
| 23 | 23 |
| 24 static inline void setup_color_table(SkColorType colorType, | 24 static inline void setup_color_table(SkColorType colorType, |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 // Initialize the swizzler | 203 // Initialize the swizzler |
| 204 fSwizzler.reset(this->initializeSwizzler(dstInfo, get_color_ptr(fColorTable.
get()), options)); | 204 fSwizzler.reset(this->initializeSwizzler(dstInfo, get_color_ptr(fColorTable.
get()), options)); |
| 205 if (nullptr == fSwizzler.get()) { | 205 if (nullptr == fSwizzler.get()) { |
| 206 return kInvalidConversion; | 206 return kInvalidConversion; |
| 207 } | 207 } |
| 208 | 208 |
| 209 fSrcBuffer.reset(fSrcRowBytes); | 209 fSrcBuffer.reset(fSrcRowBytes); |
| 210 | 210 |
| 211 return kSuccess; | 211 return kSuccess; |
| 212 } | 212 } |
| OLD | NEW |