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

Unified Diff: include/core/SkPixelRef.h

Issue 752203002: Add an Android-framework-only stable ID to SkPixelRef. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Refine comments. 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/SkPixelRef.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkPixelRef.h
diff --git a/include/core/SkPixelRef.h b/include/core/SkPixelRef.h
index 6f0421e3c4f36dbf11d440b75225ed65a15a1c04..275c1f2229be95f487ee3f919e8d2c4f8605ec74 100644
--- a/include/core/SkPixelRef.h
+++ b/include/core/SkPixelRef.h
@@ -127,6 +127,18 @@ public:
*/
uint32_t getGenerationID() const;
+#ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
+ /** Returns a non-zero, unique value corresponding to this SkPixelRef.
+ Unlike the generation ID, this ID remains the same even when the pixels
+ are changed. IDs are not reused (until uint32_t wraps), so it is safe
+ to consider this ID unique even after this SkPixelRef is deleted.
+
+ Can be used as a key which uniquely identifies this SkPixelRef
+ regardless of changes to its pixels or deletion of this object.
+ */
+ uint32_t getStableID() const { return fStableID; }
+#endif
+
/**
* Call this if you have changed the contents of the pixels. This will in-
* turn cause a different generation ID value to be returned from
@@ -358,6 +370,9 @@ private:
mutable SkTRacy<uint32_t> fGenerationID;
mutable SkTRacy<bool> fUniqueGenerationID;
+#ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
+ const uint32_t fStableID;
+#endif
SkTDArray<GenIDChangeListener*> fGenIDChangeListeners; // pointers are owned
« no previous file with comments | « no previous file | src/core/SkPixelRef.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698