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

Unified Diff: src/gpu/GrDrawTargetCaps.h

Issue 585043002: Add UniqueID to GrDrawTargetCaps. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 3 months 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 | « src/gpu/GrDrawTarget.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
};
« no previous file with comments | « src/gpu/GrDrawTarget.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698