Add support for clipstack to Gr. GrClip is now a list of rects and paths with set operations to combine them. The stencil buffer is used to perform the set operations to put the clip into the stencil buffer. Building Gr's clip from Skia's clipStack is currently disabled due to the fact that Skia's clipStack is relative to the root layer not the current layer. This will be fixed in a subsequent CL.

git-svn-id: http://skia.googlecode.com/svn/trunk@878 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gpu/src/GrPath.cpp b/gpu/src/GrPath.cpp
index 554b3b9..ca5c43b 100644
--- a/gpu/src/GrPath.cpp
+++ b/gpu/src/GrPath.cpp
@@ -3,6 +3,8 @@
 GrPath::GrPath() {}
 
 GrPath::GrPath(const GrPath& src) : INHERITED() {
+    GrPath::Iter iter(src);
+    this->resetFromIter(&iter);
 }
 
 GrPath::GrPath(GrPathIter& iter) {
@@ -12,6 +14,26 @@
 GrPath::~GrPath() {
 }
 
+bool GrPath::operator ==(const GrPath& path) const {
+    if (fVerbs.count() != path.fVerbs.count() ||
+        fPts.count() != path.fPts.count()) {
+        return false;
+    }
+
+    for (int v = 0; v < fVerbs.count(); ++v) {
+        if (fVerbs[v] != path.fVerbs[v]) {
+            return false;
+        }
+    }
+
+    for (int p = 0; p < fPts.count(); ++p) {
+        if (fPts[p] != path.fPts[p]) {
+            return false;
+        }
+    }
+    return true;
+}
+
 void GrPath::ensureMoveTo() {
     if (fVerbs.isEmpty() || this->wasLastVerb(kClose)) {
         *fVerbs.append() = kMove;
@@ -90,6 +112,7 @@
                 break;
         }
     }
+    fConvexHint = iter->convexHint();
 }
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -157,7 +180,7 @@
     return (GrPathIter::Command)cmd;
 }
 
-GrPathIter::ConvexHint GrPath::Iter::hint() const {
+GrPathIter::ConvexHint GrPath::Iter::convexHint() const {
     return fPath.getConvexHint();
 }