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

Unified Diff: src/core/SkPixelRef.cpp

Issue 752203002: Add an Android-framework-only stable ID to SkPixelRef. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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
« include/core/SkPixelRef.h ('K') | « include/core/SkPixelRef.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPixelRef.cpp
diff --git a/src/core/SkPixelRef.cpp b/src/core/SkPixelRef.cpp
index 0aa00e0bf58062fee2d3ddd7e706b81c18a44b0c..64075e5f525e9a6c7e5b31978b0433963cfc2f2e 100644
--- a/src/core/SkPixelRef.cpp
+++ b/src/core/SkPixelRef.cpp
@@ -203,6 +203,18 @@ uint32_t SkPixelRef::getGenerationID() const {
return fGenerationID;
}
+#ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
+uint32_t SkPixelRef::getStableID() const {
+ if (0 == fStableID) {
+ // Although it is okay for the stable ID to collide with a gen ID, it
+ // is also okay for them not to collide, and this allows us to share
+ // code.
+ fStableID = SkNextPixelRefGenerationID();
+ }
+ return fStableID;
+}
+#endif
+
void SkPixelRef::addGenIDChangeListener(GenIDChangeListener* listener) {
if (NULL == listener || !fUniqueGenerationID) {
// No point in tracking this if we're not going to call it.
« include/core/SkPixelRef.h ('K') | « include/core/SkPixelRef.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698