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

Unified Diff: include/core/SkPicture.h

Issue 752573002: simplify uniqueID code in picture (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: simplify loop Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/core/SkPicture.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkPicture.h
diff --git a/include/core/SkPicture.h b/include/core/SkPicture.h
index dc522a5c9d9229c771041e5c7a1c98bd0fdfc3da..e9500b25c59f01edf3608309c90a37e7edd7379d 100644
--- a/include/core/SkPicture.h
+++ b/include/core/SkPicture.h
@@ -128,12 +128,9 @@ public:
*/
SkRect cullRect() const { return fCullRect; }
- /** Return a non-zero, unique value representing the picture. This call is
- only valid when not recording. Between a beginRecording/endRecording
- pair it will just return 0 (the invalid ID). Each beginRecording/
- endRecording pair will cause a different generation ID to be returned.
- */
- uint32_t uniqueID() const;
+ /** Return a non-zero, unique value representing the picture.
+ */
+ uint32_t uniqueID() const { return fUniqueID; }
/**
* Function to encode an SkBitmap to an SkData. A function with this
@@ -249,7 +246,6 @@ private:
static const uint32_t MIN_PICTURE_VERSION = 19;
static const uint32_t CURRENT_PICTURE_VERSION = 37;
- void needsNewGenID() { fUniqueID = SK_InvalidGenID; }
void callDeletionListeners();
void createHeader(SkPictInfo* info) const;
@@ -264,12 +260,12 @@ private:
SkPicture const* const drawablePics[], int drawableCount);
// uint32_t fRefCnt; from SkNVRefCnt<SkPicture>
- mutable uint32_t fUniqueID;
+ const uint32_t fUniqueID;
const SkRect fCullRect;
mutable SkAutoTUnref<const AccelData> fAccelData;
mutable SkTDArray<DeletionListener*> fDeletionListeners; // pointers are refed
- SkAutoTDelete<SkRecord> fRecord;
- SkAutoTUnref<SkBBoxHierarchy> fBBH;
+ SkAutoTDelete<const SkRecord> fRecord;
+ SkAutoTUnref<const SkBBoxHierarchy> fBBH;
SkAutoTUnref<SkData> fDrawablePicts;
// helpers for fDrawablePicts
« no previous file with comments | « no previous file | src/core/SkPicture.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698