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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 | 45 |
46 /** | 46 /** |
47 * Return the ImageInfo associated with this codec. | 47 * Return the ImageInfo associated with this codec. |
48 */ | 48 */ |
49 const SkImageInfo& getInfo() const { return fInfo; } | 49 const SkImageInfo& getInfo() const { return fInfo; } |
50 | 50 |
51 /** | 51 /** |
52 * Return a size that approximately supports the desired scale factor. | 52 * Return a size that approximately supports the desired scale factor. |
53 * The codec may not be able to scale efficiently to the exact scale | 53 * The codec may not be able to scale efficiently to the exact scale |
54 * factor requested, so return a size that approximates that scale. | 54 * factor requested, so return a size that approximates that scale. |
| 55 * The returned value is the codec's suggestion for the closest valid |
| 56 * scale that it can natively support |
55 */ | 57 */ |
56 SkISize getScaledDimensions(float desiredScale) const { | 58 SkISize getScaledDimensions(float desiredScale) const { |
57 return this->onGetScaledDimensions(desiredScale); | 59 return this->onGetScaledDimensions(desiredScale); |
58 } | 60 } |
59 | 61 |
60 /** | 62 /** |
61 * Return (via desiredSubset) a subset which can decoded from this codec, | 63 * Return (via desiredSubset) a subset which can decoded from this codec, |
62 * or false if this codec cannot decode subsets or anything similar to | 64 * or false if this codec cannot decode subsets or anything similar to |
63 * desiredSubset. | 65 * desiredSubset. |
64 * | 66 * |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 SkStream* stream() { | 318 SkStream* stream() { |
317 return fStream.get(); | 319 return fStream.get(); |
318 } | 320 } |
319 | 321 |
320 private: | 322 private: |
321 const SkImageInfo fInfo; | 323 const SkImageInfo fInfo; |
322 SkAutoTDelete<SkStream> fStream; | 324 SkAutoTDelete<SkStream> fStream; |
323 bool fNeedsRewind; | 325 bool fNeedsRewind; |
324 }; | 326 }; |
325 #endif // SkCodec_DEFINED | 327 #endif // SkCodec_DEFINED |
OLD | NEW |