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 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 int modulus; | 295 int modulus; |
296 SkTDivMod(srcX, 8, "ient, &modulus); | 296 SkTDivMod(srcX, 8, "ient, &modulus); |
297 uint32_t shift = 7 - modulus; | 297 uint32_t shift = 7 - modulus; |
298 uint32_t alphaBit = (fSrcBuffer.get()[quotient] >> shift) & 0x1; | 298 uint32_t alphaBit = (fSrcBuffer.get()[quotient] >> shift) & 0x1; |
299 dstRow[dstX] &= alphaBit - 1; | 299 dstRow[dstX] &= alphaBit - 1; |
300 srcX += sampleX; | 300 srcX += sampleX; |
301 } | 301 } |
302 } | 302 } |
303 } | 303 } |
304 | 304 |
305 uint32_t SkBmpStandardCodec::onGetFillValue(SkColorType colorType) const { | 305 uint64_t SkBmpStandardCodec::onGetFillValue(const SkImageInfo& dstInfo) const { |
306 const SkPMColor* colorPtr = get_color_ptr(fColorTable.get()); | 306 const SkPMColor* colorPtr = get_color_ptr(fColorTable.get()); |
307 if (colorPtr) { | 307 if (colorPtr) { |
308 return get_color_table_fill_value(colorType, colorPtr, 0); | 308 return get_color_table_fill_value(dstInfo.colorType(), dstInfo.alphaType
(), colorPtr, 0, |
| 309 nullptr); |
309 } | 310 } |
310 return INHERITED::onGetFillValue(colorType); | 311 return INHERITED::onGetFillValue(dstInfo); |
311 } | 312 } |
OLD | NEW |