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 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
221 return y; | 221 return y; |
222 } | 222 } |
223 | 223 |
224 // Decode the row in destination format | 224 // Decode the row in destination format |
225 uint32_t row = this->getDstRow(y, dstInfo.height()); | 225 uint32_t row = this->getDstRow(y, dstInfo.height()); |
226 | 226 |
227 void* dstRow = SkTAddOffset<void>(dst, row * dstRowBytes); | 227 void* dstRow = SkTAddOffset<void>(dst, row * dstRowBytes); |
228 fSwizzler->swizzle(dstRow, fSrcBuffer.get()); | 228 fSwizzler->swizzle(dstRow, fSrcBuffer.get()); |
229 } | 229 } |
230 | 230 |
231 if (fInIco) { | 231 if (fInIco && fIsOpaque) { |
msarett
2016/03/22 13:49:04
There shouldn't be a transparency mask if the BMP
| |
232 const int startScanline = this->currScanline(); | 232 const int startScanline = this->currScanline(); |
233 if (startScanline < 0) { | 233 if (startScanline < 0) { |
234 // We are not performing a scanline decode. | 234 // We are not performing a scanline decode. |
235 // Just decode the entire ICO mask and return. | 235 // Just decode the entire ICO mask and return. |
236 decodeIcoMask(this->stream(), dstInfo, dst, dstRowBytes); | 236 decodeIcoMask(this->stream(), dstInfo, dst, dstRowBytes); |
237 return height; | 237 return height; |
238 } | 238 } |
239 | 239 |
240 // In order to perform a scanline ICO decode, we must be able | 240 // In order to perform a scanline ICO decode, we must be able |
241 // to skip ahead in the stream in order to apply the AND mask | 241 // to skip ahead in the stream in order to apply the AND mask |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
319 } | 319 } |
320 } | 320 } |
321 | 321 |
322 uint32_t SkBmpStandardCodec::onGetFillValue(SkColorType colorType) const { | 322 uint32_t SkBmpStandardCodec::onGetFillValue(SkColorType colorType) const { |
323 const SkPMColor* colorPtr = get_color_ptr(fColorTable.get()); | 323 const SkPMColor* colorPtr = get_color_ptr(fColorTable.get()); |
324 if (colorPtr) { | 324 if (colorPtr) { |
325 return get_color_table_fill_value(colorType, colorPtr, 0); | 325 return get_color_table_fill_value(colorType, colorPtr, 0); |
326 } | 326 } |
327 return INHERITED::onGetFillValue(colorType); | 327 return INHERITED::onGetFillValue(colorType); |
328 } | 328 } |
OLD | NEW |