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/GrTextContext.cpp b/gpu/src/GrTextContext.cpp
index 8ce45e4..802e3e3 100644
--- a/gpu/src/GrTextContext.cpp
+++ b/gpu/src/GrTextContext.cpp
@@ -67,21 +67,25 @@
 
     fCurrTexture = NULL;
     fCurrVertex = 0;
-    fClipRect = context->getClip().getBounds();
 
     if (NULL != extMatrix) {
         fExtMatrix = *extMatrix;
     } else {
         fExtMatrix = GrMatrix::I();
     }
-    if (!fExtMatrix.isIdentity()) {
-        GrMatrix inverse;
-        GrRect r;
-        r.set(fClipRect);
-        if (fExtMatrix.invert(&inverse)) {
-            inverse.mapRect(&r);
-            r.roundOut(&fClipRect);
+    if (context->getClip().hasBounds()) {
+        if (!fExtMatrix.isIdentity()) {
+            GrMatrix inverse;
+            GrRect r = context->getClip().getBounds();
+            if (fExtMatrix.invert(&inverse)) {
+                inverse.mapRect(&r);
+                r.roundOut(&fClipRect);
+            }
+        } else {
+            context->getClip().getBounds().roundOut(&fClipRect);
         }
+    } else {
+        fClipRect.setLargest();
     }
 
     // save the context's original matrix off and restore in destructor