OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
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 "SkCodec.h" | 8 #include "SkCodec.h" |
9 #include "SkImageInfo.h" | 9 #include "SkImageInfo.h" |
10 #include "SkStream.h" | 10 #include "SkStream.h" |
11 #include "SkTypes.h" | 11 #include "SkTypes.h" |
12 | 12 |
13 /* | 13 /* |
14 * This class implements the decoding for bmp images | 14 * This class implements the decoding for bmp images |
15 */ | 15 */ |
16 class SkIcoCodec : public SkCodec { | 16 class SkIcoCodec : public SkCodec { |
17 public: | 17 public: |
18 | 18 static bool IsIco(const void*, size_t); |
19 /* | |
20 * Checks the start of the stream to see if the image is a Ico or Cur | |
21 */ | |
22 static bool IsIco(SkStream*); | |
23 | 19 |
24 /* | 20 /* |
25 * Assumes IsIco was called and returned true | 21 * Assumes IsIco was called and returned true |
26 * Creates an Ico decoder | 22 * Creates an Ico decoder |
27 * Reads enough of the stream to determine the image format | 23 * Reads enough of the stream to determine the image format |
28 */ | 24 */ |
29 static SkCodec* NewFromStream(SkStream*); | 25 static SkCodec* NewFromStream(SkStream*); |
30 | 26 |
31 protected: | 27 protected: |
32 | 28 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 // Only used by the scanline decoder. onStartScanlineDecode() will set | 78 // Only used by the scanline decoder. onStartScanlineDecode() will set |
83 // fCurrScanlineCodec to one of the fEmbeddedCodecs, if it can find a | 79 // fCurrScanlineCodec to one of the fEmbeddedCodecs, if it can find a |
84 // codec of the appropriate size. We will use fCurrScanlineCodec for | 80 // codec of the appropriate size. We will use fCurrScanlineCodec for |
85 // subsequent calls to onGetScanlines() or onSkipScanlines(). | 81 // subsequent calls to onGetScanlines() or onSkipScanlines(). |
86 // fCurrScanlineCodec is owned by this class, but should not be an | 82 // fCurrScanlineCodec is owned by this class, but should not be an |
87 // SkAutoTDelete. It will be deleted by the destructor of fEmbeddedCodecs. | 83 // SkAutoTDelete. It will be deleted by the destructor of fEmbeddedCodecs. |
88 SkCodec* fCurrScanlineCodec; | 84 SkCodec* fCurrScanlineCodec; |
89 | 85 |
90 typedef SkCodec INHERITED; | 86 typedef SkCodec INHERITED; |
91 }; | 87 }; |
OLD | NEW |