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 char*, 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 21 matching lines...) Expand all Loading... |
54 * @param embeddedCodecs codecs for the embedded images, takes ownership | 50 * @param embeddedCodecs codecs for the embedded images, takes ownership |
55 */ | 51 */ |
56 SkIcoCodec(const SkImageInfo& srcInfo, | 52 SkIcoCodec(const SkImageInfo& srcInfo, |
57 SkTArray<SkAutoTDelete<SkCodec>, true>* embeddedCodecs); | 53 SkTArray<SkAutoTDelete<SkCodec>, true>* embeddedCodecs); |
58 | 54 |
59 SkAutoTDelete<SkTArray<SkAutoTDelete<SkCodec>, true>> | 55 SkAutoTDelete<SkTArray<SkAutoTDelete<SkCodec>, true>> |
60 fEmbeddedCodecs; // owned | 56 fEmbeddedCodecs; // owned |
61 | 57 |
62 typedef SkCodec INHERITED; | 58 typedef SkCodec INHERITED; |
63 }; | 59 }; |
OLD | NEW |