[GPU] tile when large bitmap pased drawBitmap and only a small fraction is used

Review URL: http://codereview.appspot.com/5450048/



git-svn-id: http://skia.googlecode.com/svn/trunk@2760 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/include/gpu/SkGpuDevice.h b/include/gpu/SkGpuDevice.h
index c34cd43..3afea5e 100644
--- a/include/gpu/SkGpuDevice.h
+++ b/include/gpu/SkGpuDevice.h
@@ -122,6 +122,8 @@
     TexCache lockCachedTexture(const SkBitmap& bitmap,
                                const GrSamplerState& sampler,
                                TexType type = kBitmap_TexType);
+    bool isBitmapInTextureCache(const SkBitmap& bitmap,
+                                const GrSamplerState& sampler) const;
     void unlockCachedTexture(TexCache);
 
     class SkAutoCachedTexture {
@@ -196,6 +198,10 @@
     bool bindDeviceAsTexture(GrPaint* paint);
 
     void prepareRenderTarget(const SkDraw&);
+    bool shouldTileBitmap(const SkBitmap& bitmap,
+                          const GrSamplerState& sampler,
+                          const SkIRect* srcRectPtr,
+                          int* tileSize) const;
     void internalDrawBitmap(const SkDraw&, const SkBitmap&,
                             const SkIRect&, const SkMatrix&, GrPaint* grPaint);