Index: src/gpu/GrDrawTarget.cpp |
diff --git a/src/gpu/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp |
index af00ac8db164bc7e0f5289d5862febaec19866ca..e942d7cf315bf233392f26e78d1ef4babae750a5 100644 |
--- a/src/gpu/GrDrawTarget.cpp |
+++ b/src/gpu/GrDrawTarget.cpp |
@@ -1147,3 +1147,13 @@ SkString GrDrawTargetCaps::dump() const { |
return r; |
} |
+ |
+uint32_t GrDrawTargetCaps::CreateUniqueID() { |
+ static int32_t gUniqueID = SK_InvalidUniqueID; |
+ uint32_t id; |
+ do { |
+ id = static_cast<uint32_t>(sk_atomic_inc(&gUniqueID) + 1); |
+ } while (id == SK_InvalidUniqueID); |
+ return id; |
+} |
+ |