Index: src/gpu/GrDrawTargetCaps.h |
diff --git a/src/gpu/GrDrawTargetCaps.h b/src/gpu/GrDrawTargetCaps.h |
index 1a3a84cf2807c32f1a71d2ffe475e56f9909c816..e468bc41ab39cf62b1c678b6ce65dd6ae6f15fb9 100644 |
--- a/src/gpu/GrDrawTargetCaps.h |
+++ b/src/gpu/GrDrawTargetCaps.h |
@@ -19,8 +19,12 @@ class GrDrawTargetCaps : public SkRefCnt { |
public: |
SK_DECLARE_INST_COUNT(GrDrawTargetCaps) |
- GrDrawTargetCaps() { this->reset(); } |
- GrDrawTargetCaps(const GrDrawTargetCaps& other) : INHERITED() { *this = other; } |
+ GrDrawTargetCaps() : fUniqueID(CreateUniqueID()) { |
+ this->reset(); |
+ } |
+ GrDrawTargetCaps(const GrDrawTargetCaps& other) : INHERITED(), fUniqueID(CreateUniqueID()) { |
+ *this = other; |
+ } |
GrDrawTargetCaps& operator= (const GrDrawTargetCaps&); |
virtual void reset(); |
@@ -77,6 +81,13 @@ public: |
return fConfigTextureSupport[config]; |
} |
+ /** |
+ * Gets an id that is unique for this GrDrawTargetCaps object. It is static in that it does |
+ * not change when the content of the GrDrawTargetCaps object changes. This will never return |
+ * 0. |
+ */ |
+ uint32_t getUniqueID() const { return fUniqueID; } |
+ |
protected: |
bool fNPOTTextureTileSupport : 1; |
bool fMipMapSupport : 1; |
@@ -103,6 +114,11 @@ protected: |
bool fConfigRenderSupport[kGrPixelConfigCnt][2]; |
bool fConfigTextureSupport[kGrPixelConfigCnt]; |
+private: |
+ static uint32_t CreateUniqueID(); |
+ |
+ const uint32_t fUniqueID; |
+ |
typedef SkRefCnt INHERITED; |
}; |