Compute clipped src rect once in tiled bitmap draws


Review URL:

git-svn-id: 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gpu/SkGpuDevice.h b/gpu/SkGpuDevice.h
index 81e0324..0862514 100644
--- a/gpu/SkGpuDevice.h
+++ b/gpu/SkGpuDevice.h
@@ -184,13 +184,16 @@
      * Helper functions called by drawBitmapCommon. By the time these are called the SkDraw's
-     * matrix has already been set on GrContext
+     * matrix, clip, and the device's render target has already been set on GrContext.
+    // The tileSize and clippedSrcRect will be valid only if true is returned.
     bool shouldTileBitmap(const SkBitmap& bitmap,
                           const GrTextureParams& sampler,
                           const SkRect* srcRectPtr,
                           int maxTileSize,
-                          int* tileSize) const;
+                          int* tileSize,
+                          SkIRect* clippedSrcRect) const;
     void internalDrawBitmap(const SkBitmap&,
                             const SkRect&,
                             const GrTextureParams& params,
@@ -198,6 +201,7 @@
                             SkCanvas::DrawBitmapRectFlags flags);
     void drawTiledBitmap(const SkBitmap& bitmap,
                          const SkRect& srcRect,
+                         const SkIRect& clippedSrcRect,
                          const GrTextureParams& params,
                          const SkPaint& paint,
                          SkCanvas::DrawBitmapRectFlags flags,