Index: src/gpu/GrProgramElement.cpp |
diff --git a/src/gpu/GrProgramElement.cpp b/src/gpu/GrProgramElement.cpp |
index 70d5339e902e81a5baf5d8a84dd1af96824dc507..20a957f7c7ca9c3eea14da883c50bb1416d195ab 100644 |
--- a/src/gpu/GrProgramElement.cpp |
+++ b/src/gpu/GrProgramElement.cpp |
@@ -8,6 +8,15 @@ |
#include "GrProgramElement.h" |
#include "GrProgramResource.h" |
+uint32_t GrProgramElement::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; |
+} |
+ |
void GrProgramElement::convertRefToPendingExecution() const { |
// This function makes it so that all the GrProgramResources own a single ref to their |
// underlying GrGpuResource if there are any refs to the GrProgramElement and a single |