OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #include "SkImageDecoder.h" | 10 #include "SkImageDecoder.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 dst[5] = (mask >> 2) & 1; | 86 dst[5] = (mask >> 2) & 1; |
87 dst[6] = (mask >> 1) & 1; | 87 dst[6] = (mask >> 1) & 1; |
88 dst[7] = (mask >> 0) & 1; | 88 dst[7] = (mask >> 0) & 1; |
89 dst += 8; | 89 dst += 8; |
90 } | 90 } |
91 | 91 |
92 bits &= 7; | 92 bits &= 7; |
93 if (bits > 0) { | 93 if (bits > 0) { |
94 unsigned mask = *src; | 94 unsigned mask = *src; |
95 do { | 95 do { |
96 *dst++ = (mask >> 7) & 1;; | 96 *dst++ = (mask >> 7) & 1; |
97 mask <<= 1; | 97 mask <<= 1; |
98 } while (--bits != 0); | 98 } while (--bits != 0); |
99 } | 99 } |
100 } | 100 } |
101 | 101 |
102 SkImageDecoder::Result SkWBMPImageDecoder::onDecode(SkStream* stream, SkBitmap*
decodedBitmap, | 102 SkImageDecoder::Result SkWBMPImageDecoder::onDecode(SkStream* stream, SkBitmap*
decodedBitmap, |
103 Mode mode) | 103 Mode mode) |
104 { | 104 { |
105 wbmp_head head; | 105 wbmp_head head; |
106 | 106 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 static SkImageDecoder::Format get_format_wbmp(SkStreamRewindable* stream) { | 164 static SkImageDecoder::Format get_format_wbmp(SkStreamRewindable* stream) { |
165 wbmp_head head; | 165 wbmp_head head; |
166 if (head.init(stream)) { | 166 if (head.init(stream)) { |
167 return SkImageDecoder::kWBMP_Format; | 167 return SkImageDecoder::kWBMP_Format; |
168 } | 168 } |
169 return SkImageDecoder::kUnknown_Format; | 169 return SkImageDecoder::kUnknown_Format; |
170 } | 170 } |
171 | 171 |
172 static SkImageDecoder_DecodeReg gDReg(sk_wbmp_dfactory); | 172 static SkImageDecoder_DecodeReg gDReg(sk_wbmp_dfactory); |
173 static SkImageDecoder_FormatReg gFormatReg(get_format_wbmp); | 173 static SkImageDecoder_FormatReg gFormatReg(get_format_wbmp); |
OLD | NEW |