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 "SkColor.h" | 8 #include "SkColor.h" |
9 #include "SkColorPriv.h" | 9 #include "SkColorPriv.h" |
10 #include "SkColorTable.h" | 10 #include "SkColorTable.h" |
11 #include "SkImageDecoder.h" | 11 #include "SkImageDecoder.h" |
12 #include "SkRTConf.h" | 12 #include "SkRTConf.h" |
13 #include "SkScaledBitmapSampler.h" | 13 #include "SkScaledBitmapSampler.h" |
14 #include "SkStream.h" | 14 #include "SkStream.h" |
15 #include "SkTemplates.h" | 15 #include "SkTemplates.h" |
16 #include "SkUtils.h" | 16 #include "SkUtils.h" |
17 | 17 |
18 #include "gif_lib.h" | 18 #include "gif_lib.h" |
19 | 19 |
20 class SkGIFImageDecoder : public SkImageDecoder { | 20 class SkGIFImageDecoder : public SkImageDecoder { |
21 public: | 21 public: |
22 virtual Format getFormat() const SK_OVERRIDE { | 22 Format getFormat() const SK_OVERRIDE { |
23 return kGIF_Format; | 23 return kGIF_Format; |
24 } | 24 } |
25 | 25 |
26 protected: | 26 protected: |
27 virtual Result onDecode(SkStream* stream, SkBitmap* bm, Mode mode) SK_OVERRI
DE; | 27 Result onDecode(SkStream* stream, SkBitmap* bm, Mode mode) SK_OVERRIDE; |
28 | 28 |
29 private: | 29 private: |
30 typedef SkImageDecoder INHERITED; | 30 typedef SkImageDecoder INHERITED; |
31 }; | 31 }; |
32 | 32 |
33 static const uint8_t gStartingIterlaceYValue[] = { | 33 static const uint8_t gStartingIterlaceYValue[] = { |
34 0, 4, 2, 1 | 34 0, 4, 2, 1 |
35 }; | 35 }; |
36 static const uint8_t gDeltaIterlaceYValue[] = { | 36 static const uint8_t gDeltaIterlaceYValue[] = { |
37 8, 8, 4, 2 | 37 8, 8, 4, 2 |
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
521 static SkImageDecoder_DecodeReg gReg(sk_libgif_dfactory); | 521 static SkImageDecoder_DecodeReg gReg(sk_libgif_dfactory); |
522 | 522 |
523 static SkImageDecoder::Format get_format_gif(SkStreamRewindable* stream) { | 523 static SkImageDecoder::Format get_format_gif(SkStreamRewindable* stream) { |
524 if (is_gif(stream)) { | 524 if (is_gif(stream)) { |
525 return SkImageDecoder::kGIF_Format; | 525 return SkImageDecoder::kGIF_Format; |
526 } | 526 } |
527 return SkImageDecoder::kUnknown_Format; | 527 return SkImageDecoder::kUnknown_Format; |
528 } | 528 } |
529 | 529 |
530 static SkImageDecoder_FormatReg gFormatReg(get_format_gif); | 530 static SkImageDecoder_FormatReg gFormatReg(get_format_gif); |
OLD | NEW |