| 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 * Construct a new SkImage based on the specified encoded data. Returns NUL
L on failure, | 74 * Construct a new SkImage based on the specified encoded data. Returns NUL
L on failure, |
| 75 * which can mean that the format of the encoded data was not recognized/su
pported. | 75 * which can mean that the format of the encoded data was not recognized/su
pported. |
| 76 * | 76 * |
| 77 * If a subset is specified, it must be contained within the encoded data's
bounds. | 77 * If a subset is specified, it must be contained within the encoded data's
bounds. |
| 78 * | 78 * |
| 79 * Regardless of success or failure, the caller is responsible for managing
their ownership | 79 * Regardless of success or failure, the caller is responsible for managing
their ownership |
| 80 * of the data. | 80 * of the data. |
| 81 */ | 81 */ |
| 82 static SkImage* NewFromEncoded(SkData* encoded, const SkIRect* subset = NULL
); | 82 static SkImage* NewFromEncoded(SkData* encoded, const SkIRect* subset = NULL
); |
| 83 | 83 |
| 84 #ifdef SK_SUPPORT_LEGACY_IMAGE_NEWFROMDATA | |
| 85 static SkImage* NewFromData(SkData* data) { | |
| 86 return NewFromEncoded(data, NULL); | |
| 87 } | |
| 88 #endif | |
| 89 | |
| 90 /** | 84 /** |
| 91 * Create a new image from the specified descriptor. Note - the caller is r
esponsible for | 85 * Create a new image from the specified descriptor. Note - the caller is r
esponsible for |
| 92 * managing the lifetime of the underlying platform texture. | 86 * managing the lifetime of the underlying platform texture. |
| 93 * | 87 * |
| 94 * Will return NULL if the specified descriptor is unsupported. | 88 * Will return NULL if the specified descriptor is unsupported. |
| 95 */ | 89 */ |
| 96 static SkImage* NewFromTexture(GrContext* ctx, const GrBackendTextureDesc& d
esc) { | 90 static SkImage* NewFromTexture(GrContext* ctx, const GrBackendTextureDesc& d
esc) { |
| 97 return NewFromTexture(ctx, desc, kPremul_SkAlphaType, NULL, NULL); | 91 return NewFromTexture(ctx, desc, kPremul_SkAlphaType, NULL, NULL); |
| 98 } | 92 } |
| 99 | 93 |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 const int fWidth; | 272 const int fWidth; |
| 279 const int fHeight; | 273 const int fHeight; |
| 280 const uint32_t fUniqueID; | 274 const uint32_t fUniqueID; |
| 281 | 275 |
| 282 static uint32_t NextUniqueID(); | 276 static uint32_t NextUniqueID(); |
| 283 | 277 |
| 284 typedef SkRefCnt INHERITED; | 278 typedef SkRefCnt INHERITED; |
| 285 }; | 279 }; |
| 286 | 280 |
| 287 #endif | 281 #endif |
| OLD | NEW |