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" |
11 #include "SkStreamPriv.h" | 11 #include "SkStreamPriv.h" |
12 #include "SkTypes.h" | 12 #include "SkTypes.h" |
13 | 13 |
14 class SkICOImageDecoder : public SkImageDecoder { | 14 class SkICOImageDecoder : public SkImageDecoder { |
15 public: | 15 public: |
16 SkICOImageDecoder(); | 16 SkICOImageDecoder(); |
17 | 17 |
18 virtual Format getFormat() const SK_OVERRIDE { | 18 Format getFormat() const SK_OVERRIDE { |
19 return kICO_Format; | 19 return kICO_Format; |
20 } | 20 } |
21 | 21 |
22 protected: | 22 protected: |
23 virtual Result onDecode(SkStream* stream, SkBitmap* bm, Mode) SK_OVERRIDE; | 23 Result onDecode(SkStream* stream, SkBitmap* bm, Mode) SK_OVERRIDE; |
24 | 24 |
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 |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 static SkImageDecoder_DecodeReg gReg(sk_libico_dfactory); | 374 static SkImageDecoder_DecodeReg gReg(sk_libico_dfactory); |
375 | 375 |
376 static SkImageDecoder::Format get_format_ico(SkStreamRewindable* stream) { | 376 static SkImageDecoder::Format get_format_ico(SkStreamRewindable* stream) { |
377 if (is_ico(stream)) { | 377 if (is_ico(stream)) { |
378 return SkImageDecoder::kICO_Format; | 378 return SkImageDecoder::kICO_Format; |
379 } | 379 } |
380 return SkImageDecoder::kUnknown_Format; | 380 return SkImageDecoder::kUnknown_Format; |
381 } | 381 } |
382 | 382 |
383 static SkImageDecoder_FormatReg gFormatReg(get_format_ico); | 383 static SkImageDecoder_FormatReg gFormatReg(get_format_ico); |
OLD | NEW |