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 #ifndef SkCodec_DEFINED | 8 #ifndef SkCodec_DEFINED |
9 #define SkCodec_DEFINED | 9 #define SkCodec_DEFINED |
10 | 10 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 } | 51 } |
52 | 52 |
53 protected: | 53 protected: |
54 SkCodec(const SkImageInfo&, SkStream*); | 54 SkCodec(const SkImageInfo&, SkStream*); |
55 | 55 |
56 /** | 56 /** |
57 * The SkAlphaType is a conservative answer. i.e. it is possible that it | 57 * The SkAlphaType is a conservative answer. i.e. it is possible that it |
58 * initially returns a non-opaque answer, but completing the decode | 58 * initially returns a non-opaque answer, but completing the decode |
59 * reveals that the image is actually opaque. | 59 * reveals that the image is actually opaque. |
60 */ | 60 */ |
| 61 #ifdef SK_SUPPORT_LEGACY_BOOL_ONGETINFO |
61 bool onGetInfo(SkImageInfo* info) SK_OVERRIDE { | 62 bool onGetInfo(SkImageInfo* info) SK_OVERRIDE { |
62 *info = fInfo; | 63 *info = fInfo; |
63 return true; | 64 return true; |
64 } | 65 } |
| 66 #endif |
65 | 67 |
66 // Helper for subclasses. | 68 // Helper for subclasses. |
67 const SkImageInfo& getOriginalInfo() { return fInfo; } | 69 const SkImageInfo& getOriginalInfo() { return fInfo; } |
68 | 70 |
69 virtual SkISize onGetScaledDimensions(float /* desiredScale */) const { | 71 virtual SkISize onGetScaledDimensions(float /* desiredScale */) const { |
70 // By default, scaling is not supported. | 72 // By default, scaling is not supported. |
71 return fInfo.dimensions(); | 73 return fInfo.dimensions(); |
72 } | 74 } |
73 | 75 |
74 /** | 76 /** |
(...skipping 17 matching lines...) Expand all Loading... |
92 * | 94 * |
93 */ | 95 */ |
94 SkStream* stream() { | 96 SkStream* stream() { |
95 return fStream.get(); | 97 return fStream.get(); |
96 } | 98 } |
97 | 99 |
98 private: | 100 private: |
99 const SkImageInfo fInfo; | 101 const SkImageInfo fInfo; |
100 SkAutoTDelete<SkStream> fStream; | 102 SkAutoTDelete<SkStream> fStream; |
101 bool fNeedsRewind; | 103 bool fNeedsRewind; |
| 104 |
| 105 typedef SkImageGenerator INHERITED; |
102 }; | 106 }; |
103 #endif // SkCodec_DEFINED | 107 #endif // SkCodec_DEFINED |
OLD | NEW |