Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: include/core/SkImage.h

Issue 1266883002: unify pixelref and image ID space, so we can share IDs when we share pixels (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/core/SkNextID.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « no previous file | src/core/SkNextID.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698