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" |
(...skipping 17 matching lines...) Expand all Loading... |
28 */ | 28 */ |
29 static SkCodec* NewFromStream(SkStream*); | 29 static SkCodec* NewFromStream(SkStream*); |
30 | 30 |
31 protected: | 31 protected: |
32 | 32 |
33 /* | 33 /* |
34 * Chooses the best dimensions given the desired scale | 34 * Chooses the best dimensions given the desired scale |
35 */ | 35 */ |
36 SkISize onGetScaledDimensions(float desiredScale) const override; | 36 SkISize onGetScaledDimensions(float desiredScale) const override; |
37 | 37 |
| 38 bool onDimensionsSupported(const SkISize&) override; |
| 39 |
38 /* | 40 /* |
39 * Initiates the Ico decode | 41 * Initiates the Ico decode |
40 */ | 42 */ |
41 Result onGetPixels(const SkImageInfo& dstInfo, void* dst, | 43 Result onGetPixels(const SkImageInfo& dstInfo, void* dst, |
42 size_t dstRowBytes, const Options&, SkPMColor*, int*) | 44 size_t dstRowBytes, const Options&, SkPMColor*, int*) |
43 override; | 45 override; |
44 | 46 |
45 SkEncodedFormat onGetEncodedFormat() const override { | 47 SkEncodedFormat onGetEncodedFormat() const override { |
46 return kICO_SkEncodedFormat; | 48 return kICO_SkEncodedFormat; |
47 } | 49 } |
48 | 50 |
49 private: | 51 private: |
50 | 52 |
51 /* | 53 /* |
52 * Constructor called by NewFromStream | 54 * Constructor called by NewFromStream |
53 * @param embeddedCodecs codecs for the embedded images, takes ownership | 55 * @param embeddedCodecs codecs for the embedded images, takes ownership |
54 */ | 56 */ |
55 SkIcoCodec(const SkImageInfo& srcInfo, | 57 SkIcoCodec(const SkImageInfo& srcInfo, |
56 SkTArray<SkAutoTDelete<SkCodec>, true>* embeddedCodecs); | 58 SkTArray<SkAutoTDelete<SkCodec>, true>* embeddedCodecs); |
57 | 59 |
58 SkAutoTDelete<SkTArray<SkAutoTDelete<SkCodec>, true>> | 60 SkAutoTDelete<SkTArray<SkAutoTDelete<SkCodec>, true>> |
59 fEmbeddedCodecs; // owned | 61 fEmbeddedCodecs; // owned |
60 | 62 |
61 typedef SkCodec INHERITED; | 63 typedef SkCodec INHERITED; |
62 }; | 64 }; |
OLD | NEW |