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

Unified Diff: src/core/SkPicture.cpp

Issue 225283014: Convert SkPicture's generation ID to a unique ID (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/core/SkTypes.h ('k') | src/gpu/GrLayerCache.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPicture.cpp
===================================================================
--- src/core/SkPicture.cpp (revision 14074)
+++ src/core/SkPicture.cpp (working copy)
@@ -140,7 +140,7 @@
if (src.fPlayback) {
fPlayback = SkNEW_ARGS(SkPicturePlayback, (*src.fPlayback));
SkASSERT(NULL == src.fRecord);
- fGenerationID = src.getGenerationID(); // need to call method to ensure != 0
+ fUniqueID = src.uniqueID(); // need to call method to ensure != 0
} else if (src.fRecord) {
SkPictInfo info;
this->createHeader(&info);
@@ -164,7 +164,7 @@
}
void SkPicture::swap(SkPicture& other) {
- SkTSwap(fGenerationID, other.fGenerationID);
+ SkTSwap(fUniqueID, other.fUniqueID);
SkTSwap(fRecord, other.fRecord);
SkTSwap(fPlayback, other.fPlayback);
SkTSwap(fAccelData, other.fAccelData);
@@ -199,7 +199,7 @@
if (fPlayback) {
clone->fPlayback = SkNEW_ARGS(SkPicturePlayback, (*fPlayback, &copyInfo));
SkASSERT(NULL == fRecord);
- clone->fGenerationID = this->getGenerationID(); // need to call method to ensure != 0
+ clone->fUniqueID = this->uniqueID(); // need to call method to ensure != 0
} else if (fRecord) {
// here we do a fake src.endRecording()
clone->fPlayback = SkNEW_ARGS(SkPicturePlayback, (*fRecord, info, true));
@@ -506,18 +506,18 @@
int32_t genID;
do {
genID = sk_atomic_inc(&gPictureGenerationID) + 1;
- } while (((int32_t)SkPicture::kInvalidGenID) == genID);
+ } while (SK_InvalidGenID == genID);
return genID;
}
-uint32_t SkPicture::getGenerationID() const {
+uint32_t SkPicture::uniqueID() const {
if (NULL != fRecord) {
SkASSERT(NULL == fPlayback);
- return kInvalidGenID;
+ return SK_InvalidGenID;
}
- if (kInvalidGenID == fGenerationID) {
- fGenerationID = next_picture_generation_id();
+ if (SK_InvalidGenID == fUniqueID) {
+ fUniqueID = next_picture_generation_id();
}
- return fGenerationID;
+ return fUniqueID;
}
« no previous file with comments | « include/core/SkTypes.h ('k') | src/gpu/GrLayerCache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698