aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/gpu/GrClip.h3
-rw-r--r--include/gpu/GrTemplates.h17
2 files changed, 11 insertions, 9 deletions
diff --git a/include/gpu/GrClip.h b/include/gpu/GrClip.h
index 6f1c5d47b2..3385c7474a 100644
--- a/include/gpu/GrClip.h
+++ b/include/gpu/GrClip.h
@@ -13,7 +13,6 @@
#include "GrClipIterator.h"
#include "GrRect.h"
-#include "GrTemplates.h"
#include "SkPath.h"
#include "SkTArray.h"
@@ -78,6 +77,8 @@ public:
}
}
+ // FIXME: This word "empty" is confusing. It means that the clip has no
+ // elements (it is the infinite plane) not that it has no area.
bool isEmpty() const { return 0 == fList.count(); }
/**
diff --git a/include/gpu/GrTemplates.h b/include/gpu/GrTemplates.h
index 63e43eed01..4378d70949 100644
--- a/include/gpu/GrTemplates.h
+++ b/include/gpu/GrTemplates.h
@@ -25,36 +25,37 @@ template <typename Dst, typename Src> Dst GrTCast(Src src) {
}
/**
- * saves value of T* in and restores in destructor
+ * takes a T*, saves the value it points to, in and restores the value in the
+ * destructor
* e.g.:
* {
- * GrAutoTPtrValueRestore<int*> autoCountRestore;
+ * GrAutoTRestore<int*> autoCountRestore;
* if (useExtra) {
- * autoCountRestore.save(&fCount);
+ * autoCountRestore.reset(&fCount);
* fCount += fExtraCount;
* }
* ...
* } // fCount is restored
*/
-template <typename T> class GrAutoTPtrValueRestore : public GrNoncopyable {
+template <typename T> class GrAutoTRestore : public GrNoncopyable {
public:
- GrAutoTPtrValueRestore() : fPtr(NULL), fVal() {}
+ GrAutoTRestore() : fPtr(NULL), fVal() {}
- GrAutoTPtrValueRestore(T* ptr) {
+ GrAutoTRestore(T* ptr) {
fPtr = ptr;
if (NULL != ptr) {
fVal = *ptr;
}
}
- ~GrAutoTPtrValueRestore() {
+ ~GrAutoTRestore() {
if (NULL != fPtr) {
*fPtr = fVal;
}
}
// restores previously saved value (if any) and saves value for passed T*
- void save(T* ptr) {
+ void reset(T* ptr) {
if (NULL != fPtr) {
*fPtr = fVal;
}