Fixed bug in drawing of large bitmaps

https://codereview.appspot.com/6595047/



git-svn-id: http://skia.googlecode.com/svn/trunk@5745 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 5b210b2..528f850 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -1331,9 +1331,6 @@
 
     int tileSize = determine_tile_size(bitmap, srcRect, maxTextureSize);
 
-    // undo the translate done by SkCanvas
-    SkScalar DX = SkMaxScalar(0, srcRect.fLeft);
-    SkScalar DY = SkMaxScalar(0, srcRect.fTop);
     // compute clip bounds in local coordinates
     SkRect clipRect;
     {
@@ -1344,8 +1341,6 @@
             return;
         }
         inverse.mapRect(&clipRect);
-        // apply the canvas' translate to our local clip
-        clipRect.offset(DX, DY);
     }
 
     int nx = bitmap.width() / tileSize;
@@ -1372,13 +1367,10 @@
             if (bitmap.extractSubset(&tmpB, iTileR)) {
                 // now offset it to make it "local" to our tmp bitmap
                 tileR.offset(SkIntToScalar(-iTileR.fLeft), SkIntToScalar(-iTileR.fTop));
-
                 SkMatrix tmpM(m);
-                {
-                    SkScalar dx = iTileR.fLeft - DX + SkMaxScalar(0, tileR.fLeft);
-                    SkScalar dy = iTileR.fTop  - DY + SkMaxScalar(0, tileR.fTop);
-                    tmpM.preTranslate(dx, dy);
-                }
+                tmpM.preTranslate(SkIntToScalar(iTileR.fLeft), 
+                                  SkIntToScalar(iTileR.fTop));
+
                 this->internalDrawBitmap(draw, tmpB, tileR, tmpM, params, grPaint);
             }
         }