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 14 matching lines...) Expand all Loading... |
25 private: | 25 private: |
26 typedef SkImageDecoder INHERITED; | 26 typedef SkImageDecoder INHERITED; |
27 }; | 27 }; |
28 | 28 |
29 ////////////////////////////////////////////////////////////////////////////////
///////// | 29 ////////////////////////////////////////////////////////////////////////////////
///////// |
30 | 30 |
31 //read bytes starting from the begin-th index in the buffer | 31 //read bytes starting from the begin-th index in the buffer |
32 //read in Intel order, and return an integer | 32 //read in Intel order, and return an integer |
33 | 33 |
34 #define readByte(buffer,begin) buffer[begin] | 34 #define readByte(buffer,begin) buffer[begin] |
35 #define read2Bytes(buffer,begin) buffer[begin]+(buffer[begin+1]<<8) | 35 #define read2Bytes(buffer,begin) buffer[begin]+SkLeftShift(buffer[begin+1],8) |
36 #define read4Bytes(buffer,begin) buffer[begin]+(buffer[begin+1]<<8)+(buffer[begi
n+2]<<16)+(buffer[begin+3]<<24) | 36 #define read4Bytes(buffer,begin) buffer[begin]+SkLeftShift(buffer[begin+1],8)+Sk
LeftShift(buffer[begin+2],16)+SkLeftShift(buffer[begin+3],24) |
37 | 37 |
38 ////////////////////////////////////////////////////////////////////////////////
///////// | 38 ////////////////////////////////////////////////////////////////////////////////
///////// |
39 | 39 |
40 SkICOImageDecoder::SkICOImageDecoder() | 40 SkICOImageDecoder::SkICOImageDecoder() |
41 { | 41 { |
42 } | 42 } |
43 | 43 |
44 //helpers - my function pointer will call one of these, depending on the bitCoun
t, each time through the inner loop | 44 //helpers - my function pointer will call one of these, depending on the bitCoun
t, each time through the inner loop |
45 static void editPixelBit1(const int pixelNo, const unsigned char* buf, | 45 static void editPixelBit1(const int pixelNo, const unsigned char* buf, |
46 const int xorOffset, int& x, int y, const int w, | 46 const int xorOffset, int& x, int y, const int w, |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 static SkImageDecoder_DecodeReg gReg(sk_libico_dfactory); | 443 static SkImageDecoder_DecodeReg gReg(sk_libico_dfactory); |
444 | 444 |
445 static SkImageDecoder::Format get_format_ico(SkStreamRewindable* stream) { | 445 static SkImageDecoder::Format get_format_ico(SkStreamRewindable* stream) { |
446 if (is_ico(stream)) { | 446 if (is_ico(stream)) { |
447 return SkImageDecoder::kICO_Format; | 447 return SkImageDecoder::kICO_Format; |
448 } | 448 } |
449 return SkImageDecoder::kUnknown_Format; | 449 return SkImageDecoder::kUnknown_Format; |
450 } | 450 } |
451 | 451 |
452 static SkImageDecoder_FormatReg gFormatReg(get_format_ico); | 452 static SkImageDecoder_FormatReg gFormatReg(get_format_ico); |
OLD | NEW |