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/GrClip.h b/include/gpu/GrClip.h
index 6f1c5d4..3385c74 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 @@
         }
     }
 
+    // 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 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;
         }