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), | 287 fWidth(width), |
288 fHeight(height), | 288 fHeight(height), |
289 fUniqueID(NextUniqueID()) { | 289 fUniqueID(uniqueID ? uniqueID : NextUniqueID()) { |
f(malita)
2015/07/30 20:24:26
Nit: since we're using a constant in subclases (kN
reed1
2015/07/30 21:17:08
Problem: that symbol is in a private header
Soluti
| |
290 | 290 |
291 SkASSERT(width > 0); | 291 SkASSERT(width > 0); |
292 SkASSERT(height > 0); | 292 SkASSERT(height > 0); |
293 } | 293 } |
294 | 294 |
295 private: | 295 private: |
296 const int fWidth; | 296 const int fWidth; |
297 const int fHeight; | 297 const int fHeight; |
298 const uint32_t fUniqueID; | 298 const uint32_t fUniqueID; |
299 | 299 |
300 static uint32_t NextUniqueID(); | 300 static uint32_t NextUniqueID(); |
301 | 301 |
302 typedef SkRefCnt INHERITED; | 302 typedef SkRefCnt INHERITED; |
303 }; | 303 }; |
304 | 304 |
305 #endif | 305 #endif |
OLD | NEW |