Index: include/gpu/GrProgramElement.h |
diff --git a/include/gpu/GrProgramElement.h b/include/gpu/GrProgramElement.h |
index 6fdc98daa9be963db13a24872a60dbfa85219f98..9fd12a7c0291ef5183bd841b2f46c2ad673f4af2 100644 |
--- a/include/gpu/GrProgramElement.h |
+++ b/include/gpu/GrProgramElement.h |
@@ -49,6 +49,11 @@ public: |
} |
} |
+ /** |
+ * Gets an id that is unique for this GrProgramElement object. This will never return 0. |
+ */ |
+ uint32_t getUniqueID() const { return fUniqueID; } |
+ |
void validate() const { |
#ifdef SK_DEBUG |
SkASSERT(fRefCnt >= 0); |
@@ -58,7 +63,7 @@ public: |
} |
protected: |
- GrProgramElement() : fRefCnt(1), fPendingExecutions(0) {} |
+ GrProgramElement() : fRefCnt(1), fPendingExecutions(0), fUniqueID(CreateUniqueID()) {} |
/** Subclasses registers their resources using this function. It is assumed the GrProgramResouce |
is and will remain owned by the subclass and this function will retain a raw ptr. Once a |
@@ -69,6 +74,8 @@ protected: |
} |
private: |
+ static uint32_t CreateUniqueID(); |
+ |
void convertRefToPendingExecution() const; |
void completedExecution() const; |
@@ -77,6 +84,8 @@ private: |
// Count of deferred executions not yet issued to the 3D API. |
mutable int32_t fPendingExecutions; |
robertphillips
2014/09/05 19:11:29
Line this up ?
bsalomon
2014/09/05 19:12:43
Done.
|
+ uint32_t fUniqueID; |
+ |
SkSTArray<4, const GrProgramResource*, true> fProgramResources; |
// Only this class can access convertRefToPendingExecution() and completedExecution(). |