| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
| 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 "SkColorPriv.h" | 8 #include "SkColorPriv.h" |
| 9 #include "SkImageDecoder.h" | 9 #include "SkImageDecoder.h" |
| 10 #include "SkStream.h" | 10 #include "SkStream.h" |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 } | 222 } |
| 223 | 223 |
| 224 //these should all be zero, but perhaps are not - need to check | 224 //these should all be zero, but perhaps are not - need to check |
| 225 //int compression = read4Bytes(buf, offset+16); //0 | 225 //int compression = read4Bytes(buf, offset+16); //0 |
| 226 //int imageSize = read4Bytes(buf, offset+20); //0 - sometimes has a
value | 226 //int imageSize = read4Bytes(buf, offset+20); //0 - sometimes has a
value |
| 227 //int xPixels = read4Bytes(buf, offset+24); //0 | 227 //int xPixels = read4Bytes(buf, offset+24); //0 |
| 228 //int yPixels = read4Bytes(buf, offset+28); //0 | 228 //int yPixels = read4Bytes(buf, offset+28); //0 |
| 229 //int colorsUsed = read4Bytes(buf, offset+32) //0 - might have an ac
tual value though | 229 //int colorsUsed = read4Bytes(buf, offset+32) //0 - might have an ac
tual value though |
| 230 //int colorsImportant = read4Bytes(buf, offset+36); //0 | 230 //int colorsImportant = read4Bytes(buf, offset+36); //0 |
| 231 | 231 |
| 232 int begin = offset + 40; | 232 int begin = SkToInt(offset + 40); |
| 233 //this array represents the colortable | 233 //this array represents the colortable |
| 234 //if i allow other types of bitmaps, it may actually be used as a part of th
e bitmap | 234 //if i allow other types of bitmaps, it may actually be used as a part of th
e bitmap |
| 235 SkPMColor* colors = NULL; | 235 SkPMColor* colors = NULL; |
| 236 int blue, green, red; | 236 int blue, green, red; |
| 237 if (colorCount) | 237 if (colorCount) |
| 238 { | 238 { |
| 239 colors = new SkPMColor[colorCount]; | 239 colors = new SkPMColor[colorCount]; |
| 240 for (int j = 0; j < colorCount; j++) | 240 for (int j = 0; j < colorCount; j++) |
| 241 { | 241 { |
| 242 //should this be a function - maybe a #define? | 242 //should this be a function - maybe a #define? |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 static SkImageDecoder_DecodeReg gReg(sk_libico_dfactory); | 424 static SkImageDecoder_DecodeReg gReg(sk_libico_dfactory); |
| 425 | 425 |
| 426 static SkImageDecoder::Format get_format_ico(SkStreamRewindable* stream) { | 426 static SkImageDecoder::Format get_format_ico(SkStreamRewindable* stream) { |
| 427 if (is_ico(stream)) { | 427 if (is_ico(stream)) { |
| 428 return SkImageDecoder::kICO_Format; | 428 return SkImageDecoder::kICO_Format; |
| 429 } | 429 } |
| 430 return SkImageDecoder::kUnknown_Format; | 430 return SkImageDecoder::kUnknown_Format; |
| 431 } | 431 } |
| 432 | 432 |
| 433 static SkImageDecoder_FormatReg gFormatReg(get_format_ico); | 433 static SkImageDecoder_FormatReg gFormatReg(get_format_ico); |
| OLD | NEW |