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