| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 SkImage_DEFINED | 8 #ifndef SkImage_DEFINED |
| 9 #define SkImage_DEFINED | 9 #define SkImage_DEFINED |
| 10 | 10 |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 * Note: this will attempt to encode the image's pixels in the specified fo
rmat, | 260 * Note: this will attempt to encode the image's pixels in the specified fo
rmat, |
| 261 * even if the image returns a data from refEncoded(). That data will be ig
nored. | 261 * even if the image returns a data from refEncoded(). That data will be ig
nored. |
| 262 */ | 262 */ |
| 263 SkData* encode(SkImageEncoder::Type, int quality) const; | 263 SkData* encode(SkImageEncoder::Type, int quality) const; |
| 264 | 264 |
| 265 /** | 265 /** |
| 266 * Encode the image and return the result as a caller-managed SkData. This
will | 266 * Encode the image and return the result as a caller-managed SkData. This
will |
| 267 * attempt to reuse existing encoded data (as returned by refEncoded). | 267 * attempt to reuse existing encoded data (as returned by refEncoded). |
| 268 * | 268 * |
| 269 * We defer to the SkPixelSerializer both for vetting existing encoded data | 269 * We defer to the SkPixelSerializer both for vetting existing encoded data |
| 270 * (useEncodedData) and for encoding the image (encodePixels) when no such
data is | 270 * (useEncodedData) and for encoding the image (encode) when no such data i
s |
| 271 * present or is rejected by the serializer. | 271 * present or is rejected by the serializer. |
| 272 * | 272 * |
| 273 * If not specified, we use a default serializer which 1) always accepts ex
isting data | 273 * If not specified, we use a default serializer which 1) always accepts ex
isting data |
| 274 * (in any format) and 2) encodes to PNG. | 274 * (in any format) and 2) encodes to PNG. |
| 275 * | 275 * |
| 276 * If no compatible encoded data exists and encoding fails, this method wil
l also | 276 * If no compatible encoded data exists and encoding fails, this method wil
l also |
| 277 * fail (return NULL). | 277 * fail (return NULL). |
| 278 */ | 278 */ |
| 279 SkData* encode(SkPixelSerializer* = nullptr) const; | 279 SkData* encode(SkPixelSerializer* = nullptr) const; |
| 280 | 280 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 | 351 |
| 352 private: | 352 private: |
| 353 const int fWidth; | 353 const int fWidth; |
| 354 const int fHeight; | 354 const int fHeight; |
| 355 const uint32_t fUniqueID; | 355 const uint32_t fUniqueID; |
| 356 | 356 |
| 357 typedef SkRefCnt INHERITED; | 357 typedef SkRefCnt INHERITED; |
| 358 }; | 358 }; |
| 359 | 359 |
| 360 #endif | 360 #endif |
| OLD | NEW |