add origin to device
used for interpreting the clipstack when a device is a layer



git-svn-id: http://skia.googlecode.com/svn/trunk@894 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gpu/src/GrClip.cpp b/gpu/src/GrClip.cpp
index 924c01b..5ba991b 100644
--- a/gpu/src/GrClip.cpp
+++ b/gpu/src/GrClip.cpp
@@ -38,9 +38,10 @@
     this->setFromRect(rect);
 }
 
-GrClip::GrClip(GrClipIterator* iter, const GrRect* bounds)
+GrClip::GrClip(GrClipIterator* iter, GrScalar tx, GrScalar ty,
+               const GrRect* bounds)
     : fList(fListMemory, kPreAllocElements) {
-    this->setFromIterator(iter, bounds);
+    this->setFromIterator(iter, tx, ty, bounds);
 }
 
 GrClip::~GrClip() {}
@@ -86,7 +87,8 @@
     }
 }
 
-void GrClip::setFromIterator(GrClipIterator* iter, const GrRect* bounds) {
+void GrClip::setFromIterator(GrClipIterator* iter, GrScalar tx, GrScalar ty,
+                             const GrRect* bounds) {
     fList.reset();
 
     int rectCount = 0;
@@ -104,6 +106,9 @@
             switch (e.fType) {
                 case kRect_ClipType:
                     iter->getRect(&e.fRect);
+                    if (tx || ty) {
+                        e.fRect.offset(tx, ty);
+                    }
                     ++rectCount;
                     if (isectRectValid) {
                         if (1 == rectCount || kIntersect_SetOp == e.fOp) {
@@ -122,6 +127,9 @@
                     break;
                 case kPath_ClipType:
                     e.fPath.resetFromIter(iter->getPathIter());
+                    if (tx || ty) {
+                        e.fPath.offset(tx, ty);
+                    }
                     e.fPathFill = iter->getPathFill();
                     isectRectValid = false;
                     break;