[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/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index c69c421..57f9a31 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -246,6 +246,16 @@
                                             GrResourceCache::kNested_LockType));
 }
 
+bool GrContext::isTextureInCache(TextureKey key,
+                                 int width,
+                                 int height,
+                                 const GrSamplerState& sampler) const {
+    uint32_t v[4];
+    gen_texture_key_values(fGpu, sampler, key, width, height, false, v);
+    GrResourceKey resourceKey(v);
+    return fTextureCache->hasKey(resourceKey);
+}
+
 GrResourceEntry* GrContext::addAndLockStencilBuffer(GrStencilBuffer* sb) {
     ASSERT_OWNED_RESOURCE(sb);
     uint32_t v[4];