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

Unified Diff: tests/PictureTest.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 | « src/gpu/GrLayerCache.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/PictureTest.cpp
===================================================================
--- tests/PictureTest.cpp (revision 14074)
+++ tests/PictureTest.cpp (working copy)
@@ -1146,52 +1146,52 @@
SkPicture hasData, empty, midRecord;
- uint32_t beforeID = hasData.getGenerationID();
- REPORTER_ASSERT(reporter, SkPicture::kInvalidGenID != beforeID);
+ uint32_t beforeID = hasData.uniqueID();
+ REPORTER_ASSERT(reporter, SK_InvalidGenID != beforeID);
// all 3 pictures should have different ids
- REPORTER_ASSERT(reporter, beforeID != empty.getGenerationID());
- REPORTER_ASSERT(reporter, beforeID != midRecord.getGenerationID());
- REPORTER_ASSERT(reporter, empty.getGenerationID() != midRecord.getGenerationID());
+ REPORTER_ASSERT(reporter, beforeID != empty.uniqueID());
+ REPORTER_ASSERT(reporter, beforeID != midRecord.uniqueID());
+ REPORTER_ASSERT(reporter, empty.uniqueID() != midRecord.uniqueID());
hasData.beginRecording(1, 1);
// gen ID should be invalid mid-record
- REPORTER_ASSERT(reporter, SkPicture::kInvalidGenID == hasData.getGenerationID());
+ REPORTER_ASSERT(reporter, SK_InvalidGenID == hasData.uniqueID());
hasData.endRecording();
// picture should get a new (non-zero) id after recording
- REPORTER_ASSERT(reporter, hasData.getGenerationID() != beforeID);
- REPORTER_ASSERT(reporter, hasData.getGenerationID() != SkPicture::kInvalidGenID);
+ REPORTER_ASSERT(reporter, hasData.uniqueID() != beforeID);
+ REPORTER_ASSERT(reporter, hasData.uniqueID() != SK_InvalidGenID);
midRecord.beginRecording(1, 1);
- REPORTER_ASSERT(reporter, SkPicture::kInvalidGenID == midRecord.getGenerationID());
+ REPORTER_ASSERT(reporter, SK_InvalidGenID == midRecord.uniqueID());
// test out copy constructor
SkPicture copyWithData(hasData);
- REPORTER_ASSERT(reporter, hasData.getGenerationID() == copyWithData.getGenerationID());
+ REPORTER_ASSERT(reporter, hasData.uniqueID() == copyWithData.uniqueID());
SkPicture emptyCopy(empty);
- REPORTER_ASSERT(reporter, empty.getGenerationID() != emptyCopy.getGenerationID());
+ REPORTER_ASSERT(reporter, empty.uniqueID() != emptyCopy.uniqueID());
SkPicture copyMidRecord(midRecord);
- REPORTER_ASSERT(reporter, midRecord.getGenerationID() != copyMidRecord.getGenerationID());
- REPORTER_ASSERT(reporter, copyMidRecord.getGenerationID() != SkPicture::kInvalidGenID);
+ REPORTER_ASSERT(reporter, midRecord.uniqueID() != copyMidRecord.uniqueID());
+ REPORTER_ASSERT(reporter, copyMidRecord.uniqueID() != SK_InvalidGenID);
// test out swap
- beforeID = copyMidRecord.getGenerationID();
+ beforeID = copyMidRecord.uniqueID();
copyWithData.swap(copyMidRecord);
- REPORTER_ASSERT(reporter, copyWithData.getGenerationID() == beforeID);
- REPORTER_ASSERT(reporter, copyMidRecord.getGenerationID() == hasData.getGenerationID());
+ REPORTER_ASSERT(reporter, copyWithData.uniqueID() == beforeID);
+ REPORTER_ASSERT(reporter, copyMidRecord.uniqueID() == hasData.uniqueID());
// test out clone
SkAutoTUnref<SkPicture> cloneWithData(hasData.clone());
- REPORTER_ASSERT(reporter, hasData.getGenerationID() == cloneWithData->getGenerationID());
+ REPORTER_ASSERT(reporter, hasData.uniqueID() == cloneWithData->uniqueID());
SkAutoTUnref<SkPicture> emptyClone(empty.clone());
- REPORTER_ASSERT(reporter, empty.getGenerationID() != emptyClone->getGenerationID());
+ REPORTER_ASSERT(reporter, empty.uniqueID() != emptyClone->uniqueID());
SkAutoTUnref<SkPicture> cloneMidRecord(midRecord.clone());
- REPORTER_ASSERT(reporter, midRecord.getGenerationID() != cloneMidRecord->getGenerationID());
- REPORTER_ASSERT(reporter, cloneMidRecord->getGenerationID() != SkPicture::kInvalidGenID);
+ REPORTER_ASSERT(reporter, midRecord.uniqueID() != cloneMidRecord->uniqueID());
+ REPORTER_ASSERT(reporter, cloneMidRecord->uniqueID() != SK_InvalidGenID);
}
DEF_TEST(Picture, reporter) {
« no previous file with comments | « src/gpu/GrLayerCache.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698