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

Unified Diff: src/gpu/GrTemplates.h

Issue 1231163002: remove some unused stuff (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 5 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/GrTBSearch.h ('k') | tests/GrTBSearchTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrTemplates.h
diff --git a/src/gpu/GrTemplates.h b/src/gpu/GrTemplates.h
index 8e43a15f7b37bbbd6a39b3b32c3ddaf8c3f38bf5..8eab9c5ef3af97f5014b60b1dd07fae83210eac0 100644
--- a/src/gpu/GrTemplates.h
+++ b/src/gpu/GrTemplates.h
@@ -22,47 +22,4 @@ template <typename Dst, typename Src> Dst GrTCast(Src src) {
return data.dst;
}
-/**
- * takes a T*, saves the value it points to, in and restores the value in the
- * destructor
- * e.g.:
- * {
- * GrAutoTRestore<int*> autoCountRestore;
- * if (useExtra) {
- * autoCountRestore.reset(&fCount);
- * fCount += fExtraCount;
- * }
- * ...
- * } // fCount is restored
- */
-template <typename T> class GrAutoTRestore : SkNoncopyable {
-public:
- GrAutoTRestore() : fPtr(NULL), fVal() {}
-
- GrAutoTRestore(T* ptr) {
- fPtr = ptr;
- if (ptr) {
- fVal = *ptr;
- }
- }
-
- ~GrAutoTRestore() {
- if (fPtr) {
- *fPtr = fVal;
- }
- }
-
- // restores previously saved value (if any) and saves value for passed T*
- void reset(T* ptr) {
- if (fPtr) {
- *fPtr = fVal;
- }
- fPtr = ptr;
- fVal = *ptr;
- }
-private:
- T* fPtr;
- T fVal;
-};
-
#endif
« no previous file with comments | « src/gpu/GrTBSearch.h ('k') | tests/GrTBSearchTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698