Make GrClipMaskManager configure the stencil and scissor on GrGpu
Review URL: http://codereview.appspot.com/6308096/
git-svn-id: http://skia.googlecode.com/svn/trunk@4288 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/include/gpu/GrTemplates.h b/include/gpu/GrTemplates.h
index 63e43ee..4378d70 100644
--- a/include/gpu/GrTemplates.h
+++ b/include/gpu/GrTemplates.h
@@ -25,36 +25,37 @@
}
/**
- * 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;
}