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 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 * a raster-backed bitmap (texture-backed bitmaps are DEPRECATED, and not s
upported here). | 276 * a raster-backed bitmap (texture-backed bitmaps are DEPRECATED, and not s
upported here). |
277 * | 277 * |
278 * If the mode is kRO (read-only), the resulting bitmap will be marked as i
mmutable. | 278 * If the mode is kRO (read-only), the resulting bitmap will be marked as i
mmutable. |
279 * | 279 * |
280 * On succcess, returns true. On failure, returns false and the bitmap para
meter will be reset | 280 * On succcess, returns true. On failure, returns false and the bitmap para
meter will be reset |
281 * to empty. | 281 * to empty. |
282 */ | 282 */ |
283 bool asLegacyBitmap(SkBitmap*, LegacyBitmapMode) const; | 283 bool asLegacyBitmap(SkBitmap*, LegacyBitmapMode) const; |
284 | 284 |
285 protected: | 285 protected: |
286 SkImage(int width, int height) : | 286 SkImage(int width, int height, uint32_t uniqueID); |
287 fWidth(width), | |
288 fHeight(height), | |
289 fUniqueID(NextUniqueID()) { | |
290 | |
291 SkASSERT(width > 0); | |
292 SkASSERT(height > 0); | |
293 } | |
294 | 287 |
295 private: | 288 private: |
296 const int fWidth; | 289 const int fWidth; |
297 const int fHeight; | 290 const int fHeight; |
298 const uint32_t fUniqueID; | 291 const uint32_t fUniqueID; |
299 | 292 |
300 static uint32_t NextUniqueID(); | |
301 | |
302 typedef SkRefCnt INHERITED; | 293 typedef SkRefCnt INHERITED; |
303 }; | 294 }; |
304 | 295 |
305 #endif | 296 #endif |
OLD | NEW |